diff --git a/README.md b/README.md index cfaa1d3..37a20c5 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,50 @@ # Italian Wikipedia Deletion Bot This projects aims to handle the public deletion log of Italian Wikipedia pages. ## History of the project The script was originally developed by Mauro762 (aka MauroBot) in 2013 using JavaScript. ## TODO Everything :) +## Installation + + apt-get install php-cli + git clone --recursive https://github.com/valerio-bozzolan/ItalianWikipediaDeletionBot + +## Configuration + +Fill `config-example.php` and save-as `config.php`. + +## Usage + + ./bot.php + ## License Original files released under [Creative Commons BY-SA 3.0 International](https://creativecommons.org/licenses/by-sa/3.0/) and [WMF terms](https://wikimediafoundation.org/wiki/Special:MyLanguage/Terms_of_Use/it) by [Mauro742](https://it.wikipedia.org/wiki/Utente:Mauro742)/[MauroBot](https://it.wikipedia.org/wiki/Utente:MauroBot): * https://it.wikipedia.org/wiki/Utente:MauroBot/BotCancellazioni/main.js * https://it.wikipedia.org/wiki/Utente:MauroBot/BotCancellazioni/bot.js * https://it.wikipedia.org/wiki/Utente:MauroBot/BotCancellazioni/category.js * https://it.wikipedia.org/wiki/Utente:MauroBot/BotCancellazioni/dateFunctions.js * https://it.wikipedia.org/wiki/Utente:MauroBot/BotCancellazioni/core.js * https://it.wikipedia.org/wiki/Utente:MauroBot/BotCancellazioni/globals.js * https://it.wikipedia.org/wiki/Utente:MauroBot/BotCancellazioni/gui.js Copyright (C) 2018 [Valerio Bozzolan](https://it.wikipedia.org/wiki/Utente:Valerio_Bozzolan) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - diff --git a/bot.php b/bot.php new file mode 100755 index 0000000..fc96f4c --- /dev/null +++ b/bot.php @@ -0,0 +1,25 @@ +#!/usr/bin/php +. + +// autoload classes +require __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'autoload.php'; + +// load credentials +require __DIR__ . DIRECTORY_SEPARATOR . 'config.php'; + +// create the category year +$year = date( 'Y' ); +itwikidelbot\CategoryYear::createIfNotExists( $year ); diff --git a/includes/autoload.php b/includes/autoload.php new file mode 100644 index 0000000..9399782 --- /dev/null +++ b/includes/autoload.php @@ -0,0 +1,26 @@ +. + +// autoload local classes +spl_autoload_register( function( $name ) { + $prefix = substr( $name, 0, 13 ); + if( 'itwikidelbot\\' === $prefix ) { + $name = substr( $name, 13 ); + require __DIR__ . DIRECTORY_SEPARATOR . "class-$name.php"; + } +} ); + +// autoload boz-php classes +require __DIR__ . DIRECTORY_SEPARATOR . 'boz-mw' . DIRECTORY_SEPARATOR . 'autoload.php';