This is the second task for T290718, Automatically matching new Wikipedia articles with Wikidata items using Python, aimed at getting you familiar with Pywikibot.
- You should register a Wikimedia account if you don't already have one. You can do so at https://www.wikidata.org/w/index.php?title=Special:CreateAccount
- You should download and install Python 3 and pywikibot - see instructions at https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation . You will need to set up a user configuration file, and make sure you can log in. Set 'wikipedia' as the base family, and then manually add usernames['wikidata']['wikidata'] = u'Your username' into the generated user-config.py file. If you want, you can set a bot password (see https://www.mediawiki.org/wiki/Manual:Pywikibot/BotPasswords ) and use that - or use your normal Wikimedia login information.
- Set up a script that will connect to Wikidata, load the 'Outreachy_1' page that you created in the previous task, and print it out.
- Try adding 'Hello' to the end of the page you just loaded, and save it back.
- Load a Wikidata item (use 'Q4115189' to start with - it is the sandbox), and print out information from it. You could also try loading some of the other items you looked at in the first task.
Save your code to a repository, or create a page like https://www.wikidata.org/wiki/User:Mike_Peel/Outreachy_2 (under your username)
Once you are happy, send me a link to your page (by email, on my talk page, or replying to this ticket as you prefer). Make sure to also register it as a contribution on the Outreachy website ( https://www.outreachy.org/outreachy-december-2021-internship-round/communities/wikimedia/automatically-matching-new-wikipedia-articles-with/contributions/ )!
Hints:
- You can find examples in https://bitbucket.org/mikepeel/wikicode/src/master/example.py
- And more at https://www.mediawiki.org/wiki/Manual:Pywikibot/Create_your_own_script