User:Eidobot

Eidobot is written by Eidolos. Please talk to him if you have any issues.

Source code
use strict; use warnings; use WWW::Mechanize; our $name   = 'name'; our $pass   = 'pass'; our $summary = 'Automated article upload'; our $sleep  = 30; # seconds to sleep after each new article opendir(NEW_ARTICLES, 'new_articles') or die "Unable to open new_articles directory: $!"; our $mech = WWW::Mechanize->new(agent => "Eidobot 1.0"); $mech->get("http://nethack.wikia.com/index.php?title=Special:Userlogin"); $mech->submit_form (  form_name => 'userlogin',   fields    => {                  wpName     => $name,                   wpPassword => $pass,                }, ); foreach my $article (sort readdir(NEW_ARTICLES)) {  next if -d $article; my $contents = do {local (@ARGV, $/) = "new_articles/$article"; <>}; $article =~ s/ /_/g; if ($mech->get("http://nethack.wikia.com/index.php?title=$article&action=edit")->content      !~ /To create the page, start typing in the box below/) {    warn "Existing article at $article. Skipping!"; next; }  $contents =~ s/^(.*)$//m and local $summary = $1 if !defined($summary) || $summary eq ''; print "Submitting new article \"$article\" (length " . length($contents) . ").\n"; $mech->submit_form (    form_name => 'editform',     fields    => {                    wpTextbox1 => $contents,                    wpSummary  => $summary,                  },   ); sleep($sleep) if defined($sleep) && $sleep > 0; }
 * 1) !/usr/bin/perl
 * 1) Copyright (c) 2006 Shawn M Moore
 * 1) Permission is hereby granted, free of charge, to any person obtaining a copy
 * 2) of this software and associated documentation files (the "Software"), to deal
 * 3) in the Software without restriction, including without limitation the rights
 * 4) to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * 5) copies of the Software, and to permit persons to whom the Software is
 * 6) furnished to do so, subject to the following conditions:
 * 1) The above copyright notice and this permission notice shall be included in al
 * 2) copies or substantial portions of the Software.
 * 1) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * 2) IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * 3) FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * 4) AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * 5) LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * 6) OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * 7) SOFTWARE.
 * 1) Eidobot 1.0
 * 2) Automates upload of new articles to Wikihack.
 * 1) It uploads every file it can in the directory called new_articles under the
 * 2) current working directory.
 * 3) The filename corresponds exactly to the new article name.
 * 1) Change the name and pass variables to your bot's name/pass.
 * 1) If the summary variable is empty or undefined, it will instead use the first
 * 2) line of each article for its summary, removing it from the article body.
 * 1) TODO: More configuration options, error-checking.
 * 1) LOGIN
 * 1) SUBMIT LOOP