Wikidata was updated this evening, but my bot still does not work with the newest pywiki in main namespace. No problem with classic MediaWiki namespaces. Can someone provide a piece of working code to read and write an item?
2012/11/11 Bináris <[email protected]> > Thanks, I suspected something like that. I changed wbentities to wbitems > and entities to items in wikipedia.py 761-793, but got a NoPage error for > an existing page. So probably the best thing is to wait for Wikidata being > updated? > > > 2012/11/11 Amir Ladsgroup <[email protected]> > >> you can see the discussion here: >> https://www.mediawiki.org/wiki/Special:Code/pywikipedia/10615 >> >> >> >> On Mon, Nov 12, 2012 at 1:59 AM, Bináris <[email protected]> wrote: >> >>> >>> 2012/10/20 <[email protected]> >>> >>> The following is a small sample just for reading a wikidata entry: >>>> >>>> trunk version: >>>> import wikipedia as wp >>>> s = wp.getSite('wikidata', 'wikidata') >>>> p = wp.Page(s, 'Q321') >>>> data = eval(p.get()) # evaluation is needed for transform text into >>>> dictionary >>>> >>> >>> This does not work for me, with the latest revision: >>> Traceback (most recent call last): >>> File "C:\Pywikipedia\wikidata-teszt.py", line 4, in <module> >>> >>> data = eval(p.get()) # evaluation is needed for transform text into >>> dictionary >>> File "C:\Pywikipedia\wikipedia.py", line 697, in get >>> expandtemplates = expandtemplates) >>> File "C:\Pywikipedia\wikipedia.py", line 778, in _getEditPage >>> data['query']={'pages':data['entities']} >>> KeyError: 'entities' >>> >>> I think there must be some change with the API, please compare >>> http://wikidata-test-repo.wikimedia.de/w/api.php to >>> https://www.wikidata.org/w/api.php >>> Could someone find the problem please? >>> >>> B. >>> >>> >>> _______________________________________________ >>> Pywikipedia-l mailing list >>> [email protected] >>> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l >>> >>> >> >> >> -- >> Amir >> >> >> >> _______________________________________________ >> Pywikipedia-l mailing list >> [email protected] >> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l >> >> > > > -- > Bináris > -- Bináris
_______________________________________________ Pywikipedia-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
