API talk:Client code/Evaluations/Java Wiki Bot Framework (JWBF)

From MediaWiki.org
Jump to navigation Jump to search

I'm interested in how to achieve the goal "generates a unique user-agent string given name/email address/repository location" --Jwbf (talk) 22:27, 23 July 2014 (UTC)

Jwbf, I'd suggest a method that takes username and/or email address, combines it with version/framework/"JWBF", and returns a WMF-approved user-agent string. See https://github.com/ianweller/python-simplemediawiki/blob/develop/simplemediawiki.py#L342 for an implementation in Python. --Fhocutt (talk) 23:36, 24 July 2014 (UTC)
I thought, the section Working with Wikimedia shows how to set a good user agent. Or are there special rules like "It is strongly recommended that the a framework (if used) is part of the useragent". In my opinion it was not necessary to append "JWBF" because it is open source and everyone could fork and change it. But if it is required, please file a issue on github. -- Btw: What do you think about, to use an special invalid username like "HeyWikimediaServerSuggestMeAUserAgent-${api-framework-with-version}" if a bot requests to domain ends with "wikipedia.org" --Jwbf (talk) 11:14, 26 July 2014 (UTC)
See also mediawiki-gateway issues 65 --Jwbf (talk) 18:55, 26 July 2014 (UTC)
jwbf, I've been going off of the example given in the user-agent meta page:

User-Agent: MyCoolTool/1.1 (http://example.com/MyCoolTool/; MyCoolTool@example.com) BasedOnSuperLib/1.4, but it's unclear whether that's a best-practices example or whether it is supposed to imply requirements. I'll email mediawiki-api and ask for clarification. --Fhocutt (talk) 20:25, 30 July 2014 (UTC)