Pywikipedia 삭제 봇 돌리기

1 개요[ | ]

pywikipedia delete.py
미디어위키 삭제 봇 돌리기

2 사전작업[ | ]

[root@zetawiki ~]# cat delete_list.txt 
# [[수정일기]]
# [[수정일기/2004-03-07]]
# [[수정일기/2004-03-08]]
... (생략)
# [[수정일기/2004-05-01]]
# [[수정일기/2004-05-02]]
# [[수정일기/2004-05-09]]

3 방법[ | ]

명령어
python delete.py
실행예시 1 (실패)
[root@zetawiki ~]# cd pywikipedia
[root@zetawiki pywikipedia]# python delete.py -file:../delete_list.txt
... (생략)
pywikibot.exceptions.NoUsername: You tried to perform an action that requires admin privileges, but you haven't
entered your sysop name in your user-config.py. Please add
sysopnames['Jmnote']['ko']='name' to your user-config.py
→ 일반 봇 권한으로는 수행 불가
[root@zetawiki pywikipedia]# cat user-config.py 
mylang='ko'
family='Jmnote'
usernames['Jmnote']['ko']='Jmnote_bot'
sysopnames['Jmnote']['ko']='Jmnote'
→ 마지막행에 관리자 계정 추가
실행예시 2 (성공)
[root@zetawiki pywikipedia]# python delete.py -file:../delete_list.txt
No handlers could be found for logger "pywiki"
Processing page 수정일기
Password for user Jmnote on Jmnote:ko:
→ 관리자 패스워드 입력 후 Enter
Logging in to Jmnote:ko as Jmnote via API.
Should be logged in now
Note: Your sysop account on Jmnote:ko does not have a bot flag. Its edits will be visible in the recent changes.
Sleeping for 45.9 seconds, 2015-01-21 22:30:08
Do you want to delete [[ko:수정일기]]? ([y]es, [N]o, [a]ll) a
Page [[ko:수정일기]] deleted
Processing page 수정일기/2004-03-07
Sleeping for 20.1 seconds, 2015-01-21 22:31:24
Page [[ko:수정일기/2004-03-07]] deleted
Processing page 수정일기/2004-03-08
Sleeping for 49.8 seconds, 2015-01-21 22:31:44
... (생략)

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}