FANDOM


This Forum has been archived

Visit the new Forums
Forums: Index Support Requests InFamous Wiki Bot, help needed
FANDOM's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

50px-Replacement filing cabinet.svg

Note: This topic has been unedited for 1508 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

The First Bot

Hey guys! I've taken on the assignment of creating the First Bot (War Clown, the crat, named her) for inFamous Wiki. Now, for starters I'm going to make it do the following:

  1. Give pages in the category inFamous the IFNav template.
  2. Make McGrath be written as MacGrath

Not much, but it's something to start with. Now, the thing is, that while I'm experienced in programming, I have no idea how to set up a bot. I can't seem to find any decent guide or how-to, so I'm kind of stuck here. The only thing I found was a MediaWiki Bot for perl, and I ended up with this:

use MediaWiki::Bot;
my $bot = MediaWiki::Bot->new({
 agent  => '$username',
       assert      => 'bot',
 operator => 'User:Alareiks',
       protocol    => 'https',
       host        => 'inFamous.wikia.com',
       path        => 'wiki/meta/w',
       login_data  => { username => "The First Bot", password => "5jkcrs" },
   });

    $bot->set_wiki({
       protocol    => 'https',
       host        => 'inFamous.wikia.com',
       path        => 'wiki/meta/w',
   });


$bot->login({
       username => $username,
       password => $password,
   }) or die "Login failed";



my @pages = $bot->get_pages_in_category('Category:inFamous');
   print "$if";
   $text = $bot->get_text('$if');
   $text .= "\n\n* \n";
   $bot->edit({
       page    => '$if',
       text    => $text,
       summary => 'Adding Navbox',
       section => 'new',
   });



Now, as I've followed a template without having any former knowledge of the MediaWiki's commands, I'm going to need help with this. Kind of sre everything is completely wrong. Would appreciate some helps. It can be links to good resources or any personal help. Edit: I may take the time to note that the password I wrote is not the password I will use for the bot, but simply something random I came up with. Dear Wishes, Alareiks 100% 13:35, July 1, 2011 (UTC)

I've got it fixed now. Alareiks | 19:18, July 25, 2011 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.