Community Central
Community Central
(New page: == 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 m...)
 
m (Removing wanted templates.)
Tag: apiedit
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
{{Forumheader|Support Requests}}
  +
  +
<!-- Please put your content under this line. Be sure to sign your edits with four tildes: ~~~~
  +
If you require staff help, please use Special:Contact or community@wikia.com to be sure of a staff reply. -->
 
== The First Bot ==
 
== The First Bot ==
   
 
Hey guys! I've taken on the assignment of creating the First Bot (War Clown, the crat, named her) for [[w::c:infamous|inFamous Wiki]]. Now, for starters I'm going to make it do the following:
 
Hey guys! I've taken on the assignment of creating the First Bot (War Clown, the crat, named her) for [[w::c:infamous|inFamous Wiki]]. Now, for starters I'm going to make it do the following:
#Give pages in the category <code> inFamous </code> the <code>IFNav </code> template.
+
#Give pages in the category <code>inFamous </code>the <code>IFNav </code>template.
 
#Make McGrath be written as MacGrath
 
#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:
 
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:
Line 33: Line 37:
 
print "$if";
 
print "$if";
 
$text = $bot->get_text('$if');
 
$text = $bot->get_text('$if');
$text .= "\n\n* {{IFnav}}\n";
+
$text .= "\n\n* \n";
 
$bot->edit({
 
$bot->edit({
 
page => '$if',
 
page => '$if',
Line 44: Line 48:
   
   
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. Dear Wishes, [[User:Alareiks|<span style="font-family:Old English Text MT;font-size:23px;color:#65000B;">Alareiks</span>]] <span style="font-family:Arial;font-size:15px;color:#B2BEB5;">100%</span> 13:35, July 1, 2011 (UTC)
+
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, [[User:Alareiks|<span style="font-family:Old English Text MT;font-size:23px;color:#65000B;">Alareiks</span>]] <span style="font-family:Arial;font-size:15px;color:#B2BEB5;">100%</span> 13:35, July 1, 2011 (UTC)
  +
  +
:I've got it fixed now. [[User:Alareiks|<span style="font-family:Impact;font-size:12px;color:#FF2400;">Alareiks</span>]] <span style="font-family:Impact;font-size:12px;color:#65000B;">'''<nowiki>|</nowiki>'''</span> 19:18, July 25, 2011 (UTC)

Latest revision as of 14:35, 5 April 2016

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.
Archive
Note: This topic has been unedited for 2927 days. It is considered archived - the discussion is over. Information in this thread may be out of date. 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)