User:Yethrosh/sandbox

From Wikidata
Jump to navigation Jump to search
#you should write your toolserver (if you have) account address like:
# /home/someone/pywikipedia/passfile
import wikipedia,config

api = 'http://wikidata.org/w/api.php'
password_fa = open("/home/shuaib/pywikipedia/passfile", 'r')
password_fa=password_fa.read().replace('"','').strip()
username = password_fa.split('(')[1].split(',')[0].split(')')[0].strip()
password = password_fa.split('(')[1].split(',')[1].split(')')[0].strip()
botflag = False # if you have a Botflag change this to True

or

api = 'http://wikidata.org/w/api.php'

username =u'your bot username'
password = u'your bot password'
botflag = False # if you have a Botflag change this to True

error[edit]

shuaib@willow:~/pywikipedia$ python new_interwiki2.py -start:! -remove
Logging in to wikidata:wikidata as Shuaib-bot via API.
Should be logged in now
Logging in to wikipedia:ur as Shuaib-bot via API.
Should be logged in now
Sleeping for 49.9 seconds, 2013-03-07 20:47:57
Getting 60 pages from wikipedia:ur...
Sleeping for 51.7 seconds, 2013-03-07 20:48:48
----------------------
IW-Item= '3 سرا اور '5 سرا
{}
for 方向性 added as label of zh
for Direkcionalnost added as label of sr
Traceback (most recent call last):
  File "new_interwiki2.py", line 535, in <module>
    main()
  File "new_interwiki2.py", line 530, in main
    run(preloadingGen,hasnew,Remove_old_interwiki)
  File "new_interwiki2.py", line 401, in run
    done=find_diff(my_data,Orgine_title,interwiki_links)
  File "new_interwiki2.py", line 331, in find_diff
    wikidata.api.save(item, summary)
  File "/home/shuaib/pywikipedia/api.py", line 64, in save
    self.request.postWithToken(params)
  File "/home/shuaib/pywikipedia/request.py", line 67, in postWithToken
    return self.post(params)
  File "/home/shuaib/pywikipedia/request.py", line 55, in post
    self._checkErrors(js)
  File "/home/shuaib/pywikipedia/request.py", line 86, in _checkErrors
    raise error(data["error"]["info"])
errors.PermissionError: Edit not allowed:
* <!---Your account or IP address has been blocked from editing Wikidata by an administrator. You will usually be able to edit your own user talk page (go to Special:MyTalk).--->
__NOEDITSECTION____NOTOC__
{| id="mw-blocked-text" style="border:2px solid #000; width:100%; margin:0 auto 6px auto;"
|
<div style="width:100%; margin:auto; text-align:center;"><div style="font-size:140%;">'''You are currently unable to edit Wikidata.'''</div>
'''''You are still able to view pages and data entries''', but you are now not able to edit, move, or create them.''
</div>
<div style="margin:auto; width:70%;">
<div style="text-align:justify;">
Editing from 91.198.174.192/27 has been '''[[WD:Blocked user|blocked]]''' (disabled) by <code>&#91;&#91;User:Merlissimo&#124;Merlissimo&#93;&#93;</code> for the following reason(s):<br clear="all">
<div style="margin:1em; padding:5px; border:3px #666 double;">Toolserver Range - no anon edits</div>
This block (ID #27)  has been set to expire: '''infinite'''.

Even if blocked, you will ''usually'' still be able to edit your [[Special:Mytalk|user talk page]] and email other editors. To discuss the block, you may contact &#91;&#91;User:Merlissimo&#124;Merlissimo&#93;&#93; or another [[{{MediaWiki:Grouppage-sysop}}|administrator]].
</div>
</div>
|}
* <!---Your account or IP address has been blocked from editing Wikidata by an administrator. You will usually be able to edit your own user talk page (go to Special:MyTalk).--->
__NOEDITSECTION____NOTOC__
{| id="mw-blocked-text" style="border:2px solid #000; width:100%; margin:0 auto 6px auto;"
|
<div style="width:100%; margin:auto; text-align:center;"><div style="font-size:140%;">'''You are currently unable to edit Wikidata.'''</div>
'''''You are still able to view pages and data entries''', but you are now not able to edit, move, or create them.''
</div>
<div style="margin:auto; width:70%;">
<div style="text-align:justify;">
Editing from 91.198.174.192/27 has been '''[[WD:Blocked user|blocked]]''' (disabled) by <code>&#91;&#91;User:Merlissimo&#124;Merlissimo&#93;&#93;</code> for the following reason(s):<br clear="all">
<div style="margin:1em; padding:5px; border:3px #666 double;">Toolserver Range - no anon edits</div>
This block (ID #27)  has been set to expire: '''infinite'''.

Even if blocked, you will ''usually'' still be able to edit your [[Special:Mytalk|user talk page]] and email other editors. To discuss the block, you may contact &#91;&#91;User:Merlissimo&#124;Merlissimo&#93;&#93; or another [[{{MediaWiki:Grouppage-sysop}}|administrator]].
</div>
</div>
|}
* <!---Your account or IP address has been blocked from editing Wikidata by an administrator. You will usually be able to edit your own user talk page (go to Special:MyTalk).--->
__NOEDITSECTION____NOTOC__
{| id="mw-blocked-text" style="border:2px solid #000; width:100%; margin:0 auto 6px auto;"
|
<div style="width:100%; margin:auto; text-align:center;"><div style="font-size:140%;">'''You are currently unable to edit Wikidata.'''</div>
'''''You are still able to view pages and data entries''', but you are now not able to edit, move, or create them.''
</div>
<div style="margin:auto; width:70%;">
<div style="text-align:justify;">
Editing from 91.198.174.192/27 has been '''[[WD:Blocked user|blocked]]''' (disabled) by <code>&#91;&#91;User:Merlissimo&#124;Merlissimo&#93;&#93;</code> for the following reason(s):<br clear="all">
<div style="margin:1em; padding:5px; border:3px #666 double;">Toolserver Range - no anon edits</div>
This block (ID #27)  has been set to expire: '''infinite'''.

Even if blocked, you will ''usually'' still be able to edit your [[Special:Mytalk|user talk page]] and email other editors. To discuss the block, you may contact &#91;&#91;User:Merlissimo&#124;Merlissimo&#93;&#93; or another [[{{MediaWiki:Grouppage-sysop}}|administrator]].
</div>
</div>
|}