Code Monkey home page Code Monkey logo

xbot's Introduction

XBot Framework

XBot framework is a full-featured platform for running automated scripts on Wikipedia. More than just a helper class for the MediaWiki api, the platform allows many different operations to run in parallel, sharing computing resources and information.

A bot processes consists of a class that extends the abstract class BotThread, located in the com.yetanotherx.xbot.bots package. As a result, every bot is a separate thread, so care must be taken to ensure proper thread safety. Each bot implements a doRun() and doShutdown() method, which get run once at startup and shutdown, respectively. In addition to each bot running in its own thread, bots can assign jobs to the thread as well, which are individual threads that are specifically assigned to the bot. They get three parameters: the parent bot thread, the time to sleep after each run, and whether or not the job should loop indefinitely. Each job class must extend the BotJob<? extends BotThread> class (an example would be "class SomeJob extends BotJob" for a job that is assigned to SomeThread). These jobs get added to the thread with the BotThread.addJob() method. This adds a job to the thread and starts it.

The bot uses a modified version of MER-C's Wiki.java. It is modified to use XBot's specific logger, as well as provide some updated features. The XBotWiki class extends this class, and provides functionality for write throttling, configuration parameters, runpage checking, and monitoring. It is accessible using the XBot.getWiki() method.

The bot also contains an interactive console, provided using the jline library. It allows for commands to be given to the bot, that allow for monitoring the state of the platform, managing which bots are running, stopping/starting the process, as well as other useful features. It also contains support for ANSI color codes, using the ChatColor class. Console output gets sent to both the standard output and a file, if the --enable-logging=true parameter is set.

XBot is open source and is available under the GNU General Public License v3.

Compiling

The bot is written for Java 6 and can be built using Maven.

Dependencies are automatically handled by Maven.

Contributing

I will happily accept contributions, especially through pull requests on GitHub. Submissions must be licensed under the GNU Lesser General Public License v3.

xbot's People

Contributors

yetanotherx avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.