Bugs item #3605408, was opened at 2013-02-20 03:39
Message generated for change (Comment added) made by amird
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605408&group_id=93107

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: update items in wikidata

Initial Comment:
I want to add new lang to an item in wikidata I use this code it says page is 
updated but it doesn't change page!

dataSite=wikipedia.getSite('wikidata','wikidata') 
data = pywikibot.DataPage(dataSite, 'Q1234')
lang='fa'
fa_title='تست'

data.setitem(summary,items={'type': u'item', 'label': lang, 'value': fa_title})
data.setitem(summary,items={'type': u'sitelink', 'site': lang, 'title': 
fa_title})


----------------------------------------------------------------------

Comment By: Amir  (amird)
Date: 2013-02-21 08:42

Message:
i know the difference between wikipedia and wikidata,. when i say do it,
trust me and do it, for god's sake. if didn't work tell me 

----------------------------------------------------------------------

Comment By: reza  (reza1615)
Date: 2013-02-21 08:30

Message:
this my code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia
dataSite=wikipedia.getSite('wikidata','wikidata')
lang='fa'
fa_title=u'قنات آب خنک، بیرجند'
summary=u'قنات آب خنک، بیرجند, قنات آب خنک،
بیرجند'

page=wikipedia.Page(dataSite,fa_title)
data = wikipedia.DataPage(page)


data.setitem(summary,items={'type': u'item', 'label': lang, 'value':
fa_title})
data.setitem(summary,items={'type': u'sitelink', 'site': lang, 'title':
fa_title})

it shows me this message

Sleeping for 9.6 seconds, 2013-02-21 16:27:25
Updating page [[wikidata:قنات آب خنک، بیرجند]] via API
Sleeping for 9.6 seconds, 2013-02-21 16:27:35
Updating page [[wikidata:قنات آب خنک، بیرجند]] via API

but it don't edit wikidata! and if you check this page you can not find it!

----------------------------------------------------------------------

Comment By: reza  (reza1615)
Date: 2013-02-21 08:13

Message:
@amir if I why should I write 
 site=wikipedia.getSite('fa',fam='wikipedia')
I want to edit in wikidata not fa.wiki.


----------------------------------------------------------------------

Comment By: xqt (xqt)
Date: 2013-02-20 23:49

Message:
you may also use

data = wikipedia.DataPage(1234)

for creating the repository Page

or

site = wikipedia.getSite()
data = wikipedia.DataPage(site.data_repository(), "Q1234")

----------------------------------------------------------------------

Comment By: Amir  (amird)
Date: 2013-02-20 04:03

Message:
you must run it in this way:
site=wikipedia.getSite('fa',fam='wikipedia')
page=wikipedia.Page(site,'تست')
data=wikipedia.DataPage(page)
data.setitem(summary,items={'type': u'item', 'label': lang, 'value':
fa_title})
data.setitem(summary,items={'type': u'sitelink', 'site': lang, 'title':
fa_title})

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605408&group_id=93107

_______________________________________________
Pywikipedia-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-bugs

Reply via email to