Jump to content

Pywikipediabot: Difference between revisions

From IdeaWazaWiki
wikademia>Millosh
No edit summary
wikademia>Eme
m moved Archive:Pywikipediabot to Pywikipediabot over redirect
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''[[meta:Using the python wikipediabot|Pywikipediabot]]''' (PWB) is the "Python Wikipediabot Framework is a set of bot scripts to do things on Wikipedia or other wikis using MediaWiki. It has been written by several people using the language Python. On this page, we give the general information for people who want to use the bot software."
Welcome to the Wikiversity learning project for '''[[meta:Using the python wikipediabot|Pywikipediabot]]''' (PWB). "Python Wikipediabot Framework is a set of bot scripts to do things on Wikipedia or other wikis using MediaWiki. It has been written by several people using the language Python. On this page, we give the general information for people who want to use the bot software."


== Needed skills ==
== Course ==


This course assumes that you know/have:
; [[Pywikipediabot/Needed skills|Needed skills]]
; [[Pywikipediabot/General basics|General basics]]
{{Pywikipediabot/General basics}}
; [[Pywikipediabot/Pywikipediabot basics|Pywikipediabot basics]]
{{Pywikipediabot/Pywikipediabot basics}}


* Installed Python on your operating system
==See also==
* Using necessary tools
*[[botwiki:]] - You may ask any question there.
* Python basics
* Introduction into Wikimedia projects
 
== Some general basics ==
 
=== Installing pywikipediabot framework ===
 
[[meta:Using the python wikipediabot|Documentation on Pywikipediabot page]] is very good. Use it for initial instructions.
 
In short, make a subdirectory inside of your working directory and go there:
 
<source lang="bash">
$ mkdir mybot
$ cd mybot
</source>
 
Invoke Subversion checkout to download pywikipediabot:
 
<source lang="bash">
$ svn checkout http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia/ pywikipedia
</source>
 
If you have a really slow connection, don't download spell-checking files:
 
<source lang="bash">
$ svn checkout --ignore-externals http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia/ pywikipedia
</source>
 
=== Logging in ===
 
Your bot should be logged in to the particular project.
 
=== Invoking Python ===
 
Your bot should assume that it is multilingual. Because of that, use [[w:UTF-8|UTF-8]] (or some better character set) and declare it at the beginning of your Python script:
 
<source lang="python">
#!/usr/bin/python
# -*- coding: utf-8 -*-
</source>
 
== Pywikipediabot basics ==
 
=== Importing basic modules ===
 
Usually, [[User:Millosh|I am]] using this approach in calling basic PWB functions (if you have some other approach, please add it here):
 
<source lang="python">
mydir = "./"
pwbdir = mydir + "pywikipedia/"
import sys
sys.path.append(pwbdir)
from wikipedia import *
</source>


[[Category:Pywikipediabot]]
[[Category:Python]]
[[Category:Python]]
[[Category:MediaWiki]]
[[Category:MediaWiki]]
[[Category:Computer programming]]
[[Category:Computer programming]]
;[[Pywikipediabot/Projects|Projects]]

Latest revision as of 17:07, 8 November 2009

Welcome to the Wikiversity learning project for Pywikipediabot (PWB). "Python Wikipediabot Framework is a set of bot scripts to do things on Wikipedia or other wikis using MediaWiki. It has been written by several people using the language Python. On this page, we give the general information for people who want to use the bot software."

Course

Needed skills
General basics
Pywikipediabot basics

See also

  • botwiki: - You may ask any question there.
Projects