Wikia

Marvel Database

Peteparker/Botxplaination

Talk0
108,257pages on
this wiki

< User:Peteparker

Want a bot?

Well, there are two, possibly three things you need to download.

  • First is python itself, and you can use this python link for that software.
  • The second is the so-called "Framework" of the Bot. Sourceforge is the link for this.
  • Finally The Sourceforge version of the Framework is a bit on the old side, so if you'd like to update it before using it, (which I recommend), download TortoiseSVN.
Python and Tortoise Installed
Python and TortoiseSVN Installed
PeteparkerAdded by Peteparker

So once you have these things, you should have a Python Program installed, a TortoiseSVN program installed, and an unzipped folder named pywikipediabot (or something).

Update
Updating with TortoiseSVN
PeteparkerAdded by Peteparker

Right-click on the recently unzipped folder, and select the TortoiseSVN option. This will automatically update to the newest versions of all the bot framework.

Then, to make it easy on yourself, copy the entire contents of this folder to the folder that python is installed in. (On mine, it was C:\python25).

New Shortcut
Creating a new shortcut
PeteparkerAdded by Peteparker

Next, it's a good idea to make a shortcut to the bot command line. This will give you something to double-click on to open the bot fresh and ready for you to use. You do this by creating a new shortcut wherever you want it to live (like the desktop), and typing cmd.exe as the location of the shortcut. Once it has been created, you'll have to right-click on it and change the properties. Change the "Start In:" line to C:\Python25 (or wherever your python program is installed). Check out this slideshow for more detailed pictures.

Whew! Now your bot is ready to use, but it's NOT set up for MarvelDatabase or for your Bot's login!

So here's how you do that:

Open notepad or another text editor.

Save the blank page as "user-config.py" (with no quotes of course) in the same folder as your python program and all the Framework of the bot.

In this page you'll have only three lines:

mylang = 'en' family = 'marveldatabase' usernames['marveldatabase']['en'] = u'YourBot'sNameHere'

'en' is the language you're using for the site. I'm assuming you're speaking English since you're reading this, and I'm speaking english.

The 'family' that you are referring to is a file Jamie will give to you when you ask him. It'll also need to be moved to the same folder everything else is in once you've downloaded it.

The username of your bot, which has traditionally been your username followed by "Bot", will go where YourBot'sNameHere is.

Once you have the three lines, save the page again and close it.

Now, if your bot's account has been created, you're ready to roll!

The first time you run your bot, type "python login.py" and hit enter. It will ask for a password, so just use the password you created for the bot's login name. You probably will never need to login again unless you change your bot's password.

The "Replace" Operation

Replace Example
Replace Example
PeteparkerAdded by Peteparker

Currently, this is the only operation that I have used. It basically takes a specific sequence of text and converts it to another sequence of text on the page or category you specify. To do one, you'd open the shortcut, and type:

python replace.py -cat:WhateverCategoryName "WhateverTextYouDon'tWant" "WhateverTextYouWant"

There are more things you can do described here and here. The first link is a little old, so there are new features in the replace command described in the second link.

REMEMBER! Any spaces in the -cat: or -page: area HAVE to be Underscores "_". Otherwise, you'll get an error and be sad your bot doesn't work.

Workin2
Bot Prompt
PeteparkerAdded by Peteparker

Now that you're set up, and probably not going to read the rest of this, I'll caution you. It's VERY easy to make a typo in the Text you want to change, and it's not so easy to fix that. Make ABSOLUTELY sure that your bot has the right commands before you decide to start changing pages. A good idea when you're trying out new commands or trying to change something for the first time is to type:

-debug

right after the replace.py. This will show you all the changes the Bot would have made without actually making any. Oh-La-La! It's a good way to practice without screwing up pages. Oh and PS, lucky for you, control-v (or paste) doesn't work in this program, so you get PLENTY of practice writing the command line. (Although up-arrow will rewrite the last command-line typed).

Problems!

One thing I've had problems with when I've been changing the Cast variables in Comic pages is that when I want one thing to change, sometimes others get caught up in the mix. Say for instance, I want to change all the pages in the Category:Jubilee/Appearances page from "= Jubilee" to "= Jubilation Lee (Earth-616)". Writing:

python replace.py -cat:Jubilee/Appearances "= Jubilee" "= Jubilation Lee (Earth-616)"

seems perfectly viable. The equals there keeps any regular occurrences of Jubilee from changing, right? WRONG. In the comics where 'Jubilee' is the Title, the same syntax: = Jubilee was in four places per issue! (Title, Image, Synopsis and Cast). The only work around I could come up with is this:

python replace.py -exceptinside:"= Jubilee " -cat:Jubilee/Appearances "= Jubilee" "= Jubilation Lee (Earth-616)"

The exceptinside thing is helpful, but requires you to know what is AROUND the text you don't want to change, which can be a pain. Sometimes, I've gone as far as putting in "| Title" and fifteen spaces before the equals just to be certain. The -debug option is our friend. . .

Well that's it. Good luck and Godspeed. Down with the Human-Editors! : )

Photos

Add a Photo
135,459photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki