Pywikibot: Add custom user agent in reflinks.py
See: https://phabricator.wikimedia.org/T113596
Add custom user agent to Pywikibot reflinks.py. It uses urllib/urllib2 and is not setting a user-agent at all, which causes outdated browser problems in some places. Custom user agent such as 'User-agent': 'Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8) Gecko/20051128 SUSE/1.5-0.1 Firefox/1.5', should be added to reflinks.py. See https://docs.python.org/2/library/urllib2.html to know how to change the user agent.
Pywikibot is a Python-based framework to write bots for MediaWiki. See https://www.mediawiki.org/wiki/Manual:Pywikibot for more information. Patches can be submitted via Gerrit (you need a MediaWiki.org account). See https://www.mediawiki.org/wiki/Manual:Pywikibot/Gerrit. After you have successfully claimed this task on this site please do use the task in Phabricator for communication instead. This allows more PWB developers to be reached! General development questions can be asked on the Pywikibot mailing list at https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l and the #pywikibot IRC channel (see https://www.mediawiki.org/wiki/MediaWiki_on_IRC ).