Pybot Wiki
(Script does something completely different on Windows and Mac machines)
 
(5 intermediate revisions by one other user not shown)
Line 11: Line 11:
 
|applicability = all [[MediaWiki]] installations
 
|applicability = all [[MediaWiki]] installations
 
}}
 
}}
'''{{PAGENAME}}''' is a [[script]] that reproduces a [[help:watchlist|watchlist]] — specifically, the list of pages being followed by the account to which [[pywikipedia]] is currently logged in.
+
'''{{PAGENAME}}''' is a [[script]] that either lists your bot account's current [[help:watchlist|watchlist]] — in [[Wikia]] terms, the list of pages that your bot is ''following'' — on [[cmd]], or, with Mackintosh computers, saves it in a folder called "watchlists" within the [[pywikipedia folder]]. It thus has different functionalities depending on the operating system.
  +
 
== Syntax ==
 
== Syntax ==
 
The syntax for this script is:
 
The syntax for this script is:
 
<pre>
 
<pre>
python watchlist.py
+
python watchlist.py
 
</pre>
 
</pre>
  +
  +
This will produce a watchlist file for the current wiki.
   
 
== Parameters ==
 
== Parameters ==
  +
{|class=wikitable
'''-all'''
 
  +
!Name
:''reloads watchlists for all wikis where a watchlist is alrady present
 
  +
!Function
'''-new'''
 
  +
|-
:''loads watchlists for all wikis referenced in [[user-config.py]]; if you use your bot account on several different wikis, this parameter will look at your watchlist on all those wikis
 
  +
| -all
 
|reloads watchlists for all wikis where a watchlist is already present
  +
|-
  +
| -new
 
|loads watchlists for all wikis referenced in [[user-config.py]]; if you use your bot account on several different wikis, this parameter will look at your watchlist on all those wikis
  +
|}
  +
 
== Use cases ==
 
== Use cases ==
No ''actual'' use cases are known. But it's a cool script. One imagines.
+
No ''actual'' use cases are known, or even imaginable.
  +
  +
== Sample output ==
  +
=== Windows ===
  +
On a [[Windows]] machine, output is given within the [[cmd]] box itself, in the format:
  +
<pre>STDOUT: Alonso Frame
  +
STDOUT: Terence Woodfield
  +
STDOUT: Skutloid
  +
STDOUT: Shur
  +
STDOUT: Amaryll
  +
</pre>
  +
  +
=== OS X ===
  +
In [[Apple]] systems, output is in a separate file in a folder called "Watchlists" in the [[pywikipedia folder]]. It uses an even more unusual, but at least regular, format:
  +
<pre>
  +
(lp0
  +
VAlonso Frame
  +
p1
  +
aVTerence Woodfield
  +
p2
  +
aVSkutloid
  +
p3
  +
aVShur
  +
p4
  +
aVAmaryll
  +
p5
  +
</pre>
  +
As can be seen, the letters '''aV''' appear before every entry, except for the first one, and the page numbers appear underneath. Why this format obtains is unclear.
  +
  +
It's also uncertain why, on Mac systems, the resultant file has a .dat extension. This is usually associated with video files, so Mac users have to force target the opening application to be something like TextEdit.
  +
  +
The utility of this list is therefore obscure. It doesn't even help you ''manage'' your watchlist, which can be more effectively done at [[Special:EditWatchlist/raw]].
  +
[[Category:List scripts]]

Latest revision as of 22:20, 4 March 2014

This page describes a script. In general, it refers to the script in its current form, but pywikpedia coders tend only to add functions, not take them away. Chances are that you'll be able to use most of the information on the page, regardless of the age of your installation.

Watchlist.py
Creator:
Daniel Herding
Pywikipedia team
Code location: mediawiki repository
What it does: Produces your bot account's watchlist
Complexity: Basic
Applicability: all MediaWiki installations

Watchlist.py is a script that either lists your bot account's current watchlist — in Wikia terms, the list of pages that your bot is following — on cmd, or, with Mackintosh computers, saves it in a folder called "watchlists" within the pywikipedia folder. It thus has different functionalities depending on the operating system.

Syntax[]

The syntax for this script is:

python watchlist.py 

This will produce a watchlist file for the current wiki.

Parameters[]

Name Function
-all reloads watchlists for all wikis where a watchlist is already present
-new loads watchlists for all wikis referenced in user-config.py; if you use your bot account on several different wikis, this parameter will look at your watchlist on all those wikis

Use cases[]

No actual use cases are known, or even imaginable.

Sample output[]

Windows[]

On a Windows machine, output is given within the cmd box itself, in the format:

STDOUT: Alonso Frame
STDOUT: Terence Woodfield
STDOUT: Skutloid
STDOUT: Shur
STDOUT: Amaryll

OS X[]

In Apple systems, output is in a separate file in a folder called "Watchlists" in the pywikipedia folder. It uses an even more unusual, but at least regular, format:

(lp0
VAlonso Frame
p1
aVTerence Woodfield
p2
aVSkutloid
p3
aVShur
p4
aVAmaryll
p5

As can be seen, the letters aV appear before every entry, except for the first one, and the page numbers appear underneath. Why this format obtains is unclear.

It's also uncertain why, on Mac systems, the resultant file has a .dat extension. This is usually associated with video files, so Mac users have to force target the opening application to be something like TextEdit.

The utility of this list is therefore obscure. It doesn't even help you manage your watchlist, which can be more effectively done at Special:EditWatchlist/raw.