"리눅스 Pywikibot 설치"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-== 참고 자료 == +==참고==))
잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 2개는 보이지 않습니다)
2번째 줄: 2번째 줄:


==다운로드 및 설치==
==다운로드 및 설치==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# wget http://tools.wmflabs.org/pywikibot/core_stable.tar.gz
root@zetawiki:~# wget http://tools.wmflabs.org/pywikibot/core_stable.tar.gz
--2016-03-28 20:13:04--  http://tools.wmflabs.org/pywikibot/core_stable.tar.gz
--2016-03-28 20:13:04--  http://tools.wmflabs.org/pywikibot/core_stable.tar.gz
14번째 줄: 14번째 줄:


2016-03-28 20:13:08 (9.18 MB/s) - ‘core_stable.tar.gz’ saved [28386664/28386664]
2016-03-28 20:13:08 (9.18 MB/s) - ‘core_stable.tar.gz’ saved [28386664/28386664]
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# tar xvzf core_stable.tar.gz
root@zetawiki:~# tar xvzf core_stable.tar.gz
core_stable/externals/httplib2/doc/html/_sources/index.txt
core_stable/externals/httplib2/doc/html/_sources/index.txt
21번째 줄: 21번째 줄:
core_stable/user-config.py.sample
core_stable/user-config.py.sample
core_stable/.travis.yml
core_stable/.travis.yml
</source>
</syntaxhighlight>


==설정==
==설정==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# cd core_stable/
root@zetawiki:~# cd core_stable/
root@zetawiki:~/core_stable# cat user-config.py.sample
root@zetawiki:~/core_stable# cat user-config.py.sample
37번째 줄: 37번째 줄:
root@zetawiki:~/core_stable# cp user-config.py.sample user-config.py
root@zetawiki:~/core_stable# cp user-config.py.sample user-config.py
root@zetawiki:~/core_stable# vi user-config.py
root@zetawiki:~/core_stable# vi user-config.py
</source>
</syntaxhighlight>
<source lang='py'>
<syntaxhighlight lang='py'>
# -*- coding: utf-8  -*-
# -*- coding: utf-8  -*-


47번째 줄: 47번째 줄:
family = 'zetawiki'
family = 'zetawiki'
usernames['zetawiki']['ko'] = 'Jmnote_bot'
usernames['zetawiki']['ko'] = 'Jmnote_bot'
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~/core_stable# cd pywikibot/families/
root@zetawiki:~/core_stable# cd pywikibot/families/
root@zetawiki:~/core_stable/pywikibot/families# cat wikitech_family.py
root@zetawiki:~/core_stable/pywikibot/families# cat wikitech_family.py
73번째 줄: 73번째 줄:
root@zetawiki:~/core_stable/pywikibot/families# cp wikitech_family.py zetawiki_family.py
root@zetawiki:~/core_stable/pywikibot/families# cp wikitech_family.py zetawiki_family.py
root@zetawiki:~/core_stable/pywikibot/families# vi zetawiki_family.py
root@zetawiki:~/core_stable/pywikibot/families# vi zetawiki_family.py
</source>
</syntaxhighlight>
<source lang='py'>
<syntaxhighlight lang='py'>
# -*- coding: utf-8  -*-
# -*- coding: utf-8  -*-
"""Family module for Zetawiki."""
"""Family module for Zetawiki."""
95번째 줄: 95번째 줄:
         """Return the protocol for this family."""
         """Return the protocol for this family."""
         return 'http'
         return 'http'
</source>
</syntaxhighlight>


==로그인==
==로그인==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~/core_stable/pywikibot/families# cd ../..
root@zetawiki:~/core_stable/pywikibot/families# cd ../..
root@zetabbs:~/core_stable# python pwb.py login
root@zetabbs:~/core_stable# python pwb.py login
104번째 줄: 104번째 줄:
Logging in to zetawiki:ko as Jmnote bot
Logging in to zetawiki:ko as Jmnote bot
Logged in on zetawiki:ko as Jmnote bot.
Logged in on zetawiki:ko as Jmnote bot.
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[Pywikibot 이중 넘겨주기 봇 돌리기]]
* [[Pywikibot 이중 넘겨주기 봇 돌리기]]
*<del>[[Pywikipedia 설치]]</del>
* [[윈도우 Pywikibot 설치]]
* [[Pywikibot]]
* <del>[[Pywikipedia 설치]]</del>


==참고==
==참고==

2020년 11월 2일 (월) 02:59 기준 최신판

Pywikibot 설치

1 다운로드 및 설치[ | ]

root@zetawiki:~# wget http://tools.wmflabs.org/pywikibot/core_stable.tar.gz
--2016-03-28 20:13:04--  http://tools.wmflabs.org/pywikibot/core_stable.tar.gz
Resolving tools.wmflabs.org (tools.wmflabs.org)... 208.80.155.131
Connecting to tools.wmflabs.org (tools.wmflabs.org)|208.80.155.131|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28386664 (27M) [application/octet-stream]
Saving to: ‘core_stable.tar.gz’

100%[===========================================================>] 28,386,664  9.18MB/s   in 2.9s   

2016-03-28 20:13:08 (9.18 MB/s) - ‘core_stable.tar.gz’ saved [28386664/28386664]
root@zetawiki:~# tar xvzf core_stable.tar.gz
core_stable/externals/httplib2/doc/html/_sources/index.txt
core_stable/externals/README
core_stable/user-config.py.sample
core_stable/.travis.yml

2 설정[ | ]

root@zetawiki:~# cd core_stable/
root@zetawiki:~/core_stable# cat user-config.py.sample
# -*- coding: utf-8  -*-

# This is a sample file. You should use generate_user_files.py
# to create your user-config.py file.

mylang = 'en'
family = 'wikipedia'
usernames['wikipedia']['en'] = 'Test'
root@zetawiki:~/core_stable# cp user-config.py.sample user-config.py
root@zetawiki:~/core_stable# vi user-config.py
# -*- coding: utf-8  -*-

# This is a sample file. You should use generate_user_files.py
# to create your user-config.py file.

mylang = 'ko'
family = 'zetawiki'
usernames['zetawiki']['ko'] = 'Jmnote_bot'
root@zetawiki:~/core_stable# cd pywikibot/families/
root@zetawiki:~/core_stable/pywikibot/families# cat wikitech_family.py
# -*- coding: utf-8  -*-
"""Family module for Wikitech."""
from __future__ import unicode_literals

__version__ = '$Id: 5cba33c05874a5b4074c5dd7aa04a7e16a8279c2 $'

from pywikibot import family


# The Wikitech family
class Family(family.Family):

    """Family class for Wikitech."""

    name = 'wikitech'
    langs = {'en': 'wikitech.wikimedia.org'}

    def protocol(self, code):
        """Return the protocol for this family."""
        return 'https'
root@zetawiki:~/core_stable/pywikibot/families# cp wikitech_family.py zetawiki_family.py
root@zetawiki:~/core_stable/pywikibot/families# vi zetawiki_family.py
# -*- coding: utf-8  -*-
"""Family module for Zetawiki."""
from __future__ import unicode_literals

__version__ = '$Id: 5cba33c05874a5b4074c5dd7aa04a7e16a8279c2 $'

from pywikibot import family


# The Zetawiki family
class Family(family.Family):

    """Family class for Zetawiki."""

    name = 'zetawiki'
    langs = {'ko': 'zetawiki.com'}

    def protocol(self, code):
        """Return the protocol for this family."""
        return 'http'

3 로그인[ | ]

root@zetawiki:~/core_stable/pywikibot/families# cd ../..
root@zetabbs:~/core_stable# python pwb.py login
Password for user Jmnote bot on zetawiki:ko (no characters will be shown): P@ssw0rd
Logging in to zetawiki:ko as Jmnote bot
Logged in on zetawiki:ko as Jmnote bot.

4 같이 보기[ | ]

5 참고[ | ]

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