[PerlWikiBot] SF.net SVN: perlwikibot:[38] trunk
Status: Pre-Alpha
Brought to you by:
rotemliss
|
From: <rot...@us...> - 2008-07-28 13:35:50
|
Revision: 38
http://perlwikibot.svn.sourceforge.net/perlwikibot/?rev=38&view=rev
Author: rotemliss
Date: 2008-07-28 13:35:57 +0000 (Mon, 28 Jul 2008)
Log Message:
-----------
Make place to more modules.
Added Paths:
-----------
trunk/perlwikibot/
trunk/perlwikibot/README
trunk/perlwikibot/bot.pl
trunk/perlwikibot/config/
trunk/perlwikibot/dumps/
trunk/perlwikibot/includes/
Removed Paths:
-------------
trunk/README
trunk/bot.pl
trunk/config/
trunk/dumps/
trunk/includes/
Deleted: trunk/README
===================================================================
--- trunk/README 2007-03-24 15:51:07 UTC (rev 37)
+++ trunk/README 2008-07-28 13:35:57 UTC (rev 38)
@@ -1,13 +0,0 @@
-This is a bot which was written in Perl, for using on MediaWiki sites - especially Wikimedia Foundation projects.
-
-This bot is copyrighted under the terms of GNU GPL. It's based on original work of both Costello and Felagund (Nadav) from Hebrew Wikipedia. Authors:
-* Rotem Liss
-
-The file includes/dump.pm was downloaded from:
-http://search.cpan.org/~triddle/Parse-MediaWikiDump-0.31/
-
-You should get the XML file includes all the pages, but only their current revision. It is called pages-meta-current.xml.bz2 in http://download.wikimedia.org/, and you have to use "maintenance/dumpBackup.php --current" to create it in your own installation. Now extract it in "dumps".
-
-Now copy the files "configure.sample" and "runtime.sample" in the folder "config" to the names "configure.pm" and "runtime.pm", and configure them. You should first go to the configure file, then define the servers, then the actions, then go to the runtime file and define there what actions to execute, and most importantly - set "$sendPages" to 1, after the tests.
-
-After that, you can run the file "bot.pl", with the parameter of the site name, and the parameter "sysop" if you want to use the sysop user (if you don't use it, actions which require sysop rights won't be executed). In later times, you can edit the configure file when you want to change the actions, and always edit the run-time file to enable and disable the page sends, and to define the actions to do.
Deleted: trunk/bot.pl
===================================================================
--- trunk/bot.pl 2007-03-24 15:51:07 UTC (rev 37)
+++ trunk/bot.pl 2008-07-28 13:35:57 UTC (rev 38)
@@ -1,59 +0,0 @@
-#!/usr/bin/perl
-
-# Code style
-use warnings;
-use strict;
-
-# Libraries
-use includes::actions;
-use includes::dump;
-use includes::functions;
-use includes::http;
-use config::configure;
-use config::runtime;
-
-# Do nothing if no server specified
-if ( !$ARGV[0] ) {
- die "No server name set - please set server name!\n";
-}
-
-my $sysop;
-if ( $ARGV[1] eq "sysop" ) {
- $sysop = 1;
-} else {
- $sysop = 0;
-}
-
-# Show notes about the sending pages configuration
-if ( $configure::sendPages == 0 ) {
- print "Note: There will be no changes in the real server. Please set sendPages to 1 to do them.\n";
-} elsif ( $configure::sendPages == 2 ) {
- print "Note: A prefix will be used when editing pages. Please set sendPages to 1 to disable that.\n";
-}
-
-# Log in to the server only if you have to do some stuff in the server
-if ( $configure::sendPages == 1 || $configure::sendPages == 2 ) {
- functions::login( $sysop );
-}
-
-# All the matching pages in the XML file
-my @pages = functions::getMatchingPages( $sysop );
-
-# Execute actions of all the pages
-for ( my $i = 0; $i <= $#pages; $i += 2 ) {
- # Get title and action
- my $title = $pages[$i];
- my $action = $pages[$i + 1];
- my $actionName = $configure::actions{ $action };
-
- # Execute the action
- if ( $actionName eq "replace" ) {
- functions::replaceInPage( $title, $action );
- } elsif ( $actionName eq "refresh" ) {
- functions::refreshPage( $title, $action );
- } elsif ( $actionName eq "move" ) {
- functions::movePage( $title, $action );
- } elsif ( $actionName eq "delete" ) {
- functions::deletePage( $title, $action );
- }
-}
Copied: trunk/perlwikibot/README (from rev 37, trunk/README)
===================================================================
--- trunk/perlwikibot/README (rev 0)
+++ trunk/perlwikibot/README 2008-07-28 13:35:57 UTC (rev 38)
@@ -0,0 +1,13 @@
+This is a bot which was written in Perl, for using on MediaWiki sites - especially Wikimedia Foundation projects.
+
+This bot is copyrighted under the terms of GNU GPL. It's based on original work of both Costello and Felagund (Nadav) from Hebrew Wikipedia. Authors:
+* Rotem Liss
+
+The file includes/dump.pm was downloaded from:
+http://search.cpan.org/~triddle/Parse-MediaWikiDump-0.31/
+
+You should get the XML file includes all the pages, but only their current revision. It is called pages-meta-current.xml.bz2 in http://download.wikimedia.org/, and you have to use "maintenance/dumpBackup.php --current" to create it in your own installation. Now extract it in "dumps".
+
+Now copy the files "configure.sample" and "runtime.sample" in the folder "config" to the names "configure.pm" and "runtime.pm", and configure them. You should first go to the configure file, then define the servers, then the actions, then go to the runtime file and define there what actions to execute, and most importantly - set "$sendPages" to 1, after the tests.
+
+After that, you can run the file "bot.pl", with the parameter of the site name, and the parameter "sysop" if you want to use the sysop user (if you don't use it, actions which require sysop rights won't be executed). In later times, you can edit the configure file when you want to change the actions, and always edit the run-time file to enable and disable the page sends, and to define the actions to do.
Copied: trunk/perlwikibot/bot.pl (from rev 37, trunk/bot.pl)
===================================================================
--- trunk/perlwikibot/bot.pl (rev 0)
+++ trunk/perlwikibot/bot.pl 2008-07-28 13:35:57 UTC (rev 38)
@@ -0,0 +1,59 @@
+#!/usr/bin/perl
+
+# Code style
+use warnings;
+use strict;
+
+# Libraries
+use includes::actions;
+use includes::dump;
+use includes::functions;
+use includes::http;
+use config::configure;
+use config::runtime;
+
+# Do nothing if no server specified
+if ( !$ARGV[0] ) {
+ die "No server name set - please set server name!\n";
+}
+
+my $sysop;
+if ( $ARGV[1] eq "sysop" ) {
+ $sysop = 1;
+} else {
+ $sysop = 0;
+}
+
+# Show notes about the sending pages configuration
+if ( $configure::sendPages == 0 ) {
+ print "Note: There will be no changes in the real server. Please set sendPages to 1 to do them.\n";
+} elsif ( $configure::sendPages == 2 ) {
+ print "Note: A prefix will be used when editing pages. Please set sendPages to 1 to disable that.\n";
+}
+
+# Log in to the server only if you have to do some stuff in the server
+if ( $configure::sendPages == 1 || $configure::sendPages == 2 ) {
+ functions::login( $sysop );
+}
+
+# All the matching pages in the XML file
+my @pages = functions::getMatchingPages( $sysop );
+
+# Execute actions of all the pages
+for ( my $i = 0; $i <= $#pages; $i += 2 ) {
+ # Get title and action
+ my $title = $pages[$i];
+ my $action = $pages[$i + 1];
+ my $actionName = $configure::actions{ $action };
+
+ # Execute the action
+ if ( $actionName eq "replace" ) {
+ functions::replaceInPage( $title, $action );
+ } elsif ( $actionName eq "refresh" ) {
+ functions::refreshPage( $title, $action );
+ } elsif ( $actionName eq "move" ) {
+ functions::movePage( $title, $action );
+ } elsif ( $actionName eq "delete" ) {
+ functions::deletePage( $title, $action );
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|