From Apibot
Revision as of 17:50, 19 October 2014 by Grigor Gatchev (talk | contribs) (minor improvements)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


What is a wiki

A wiki is typically an Internet site, where people can work together to create useful texts, appending and improving each other's contributions. Wikipedia is an example.

A wiki is powered by a wiki software. The (arguably) most popular wiki software, which runs eg. Wikipedia, is MediaWiki.

What is MediaWiki bot

This term refers colloquially to two different things:

  • a "MediaWiki bot" software
  • a wiki account that is used by a bot software instead of by a human editor

Not all work in a wiki is creative. There is enough of high-volume, repetitive, boring work. To help the wiki contributors, there are many softwares - computer programs - created to do such a work. Such a software is called wiki bot.

Different wikis require specific bot software. A bot software that works with MediaWiki is called MediaWiki bot.

What is Apibot

Apibot is a MediaWiki bot software. It is written in PHP - the language that MediaWiki itself is written in. You command it by writing small and simple PHP scripts that use the already present ones. (If you don't know PHP, but know some other programming language, it will take you no more than a couple of hours to learn PHP enough for that.)

(Yes, I have considered the idea to write a web interface for it many times. However, this will take a lot of work, and I'm already overloaded with writing the bot itself.)

Many other MediaWiki bot softwares exist, too.

Who uses MediaWiki bots

Wiki bots do a lot of work, so erroneous instructions might do a lot of harm. Also, most types of bot work are best described by programming instructions. For these reasons, wiki bots are used mostly by people with some computer programming experience. (If you don't have it, this doesn't mean that you cannot use a wiki bot - it means only that you have to obtain some programming experience first. :-) )

Some bots are made to be usable to people with little or no programming experience at all - typically through some web interface. These bots are typically very specialized, eg. just for reverting vandal changes, or just for moving all pages from one category to another.

A person who uses a bot on a wiki is typically called bot operator.

How to use a bot

Typically, a bot operator will register in the wiki a separate account for his/her bot - a bot account. Sometimes several different accounts may be registered, if the bot does several different types of work. Sometimes the bot operator will use his/her own account for the bot, too. Most wikis have some accepted rules or informal agreements on this.

Most wikis also have other rules on using bots. For example, they might limit the amount of work a bot does in order to prevent site overload. Or they might require some types of work to be done manually.

In most wikis, including MediaWiki, a bot account can be given bot rights. These are some privileges that smooth its work.

About the wiki

Why I can't edit this wiki?

Because you don't need to. This wiki is written by the authors of Apibot. If you would like to contribute, even if only with proofreading the site texts, the team page contains instructions how to join.

Installation / Work

Will Apibot run on Windows / Linux / BSD...?

Apibot is a PHP program. If an OS can run the PHP language interpreter (almost every OS in current usage can), then Apibot can run on it.

Specific requirements

Apibot needs PHP 5.2 or later version, with multibyte support installed. If the Zlib module is installed, it will also be able to use transfer compression (and will communicate with remote sites faster and will make less traffic).

Apibot uses a lot of RAM. Smaller tasks using the Bridge interface and connecting to wikis with little wiki info might be able to run on 32 MB. Bigger tasks might require 128 MB or even more. Change the PHP .ini file accordingly, or use in your script the PHP ini_set ( 'memory_limit', 128M ) directive (with the amount of RAM you need), or set it to the appropriate part of the Apibot configuration.

Why Apibot starts so slowly

It does that either when run for first time, or when updated with a much newer version that carries a lot of changes. Don't worry, it will run much faster the second time. :-)

When a .PHP file is new or changes, the PHP interpreter on inclusion recompiles it to a special code. This speeds up the PHP scripts execution enormously, but takes some time when done for a first time. The full codebase of Apibot is over three megabytes, which is a lot to compile, and may cause some delay in a first start on a slower machine.

Is Apibot 0.4x compatible with Apibot 0.3x

No, it is not. (Though the difference is not big.)

The structure of Apibot 0.3x version was mostly monolithic - one huge PHP class containing all the functionality. The increasing number of functions and abilities made this approach impossible. For example, Apibot 0.32 offers a bit over 300 functions, while only the Info class of Apibot 0.40 will offer over 500. Also, the monolithic approach didn't allowed for easy and convenient extension through plugins, which made the development increasingly harder.

The difference between the versions, however, is relatively small. Porting scripts written for 0.3x to 0.4x should be easy. So, the gain more than makes up for the loss of compatibility. :-)

Extending Apibot

May I extend Apibot code and/or documentation

Yes you may, on certain conditions.

If you want to extend the Apibot core or interfaces, your code must be licensed under the GNU Affero General Public License, version 3.0 or any later. This is the license that governs the Apibot code.

If you want to write some Apibot documentation that should be distributed with it freely, it must be licensed under the GNU Free Documentation License, version 2.0 or any later. This is the license that governs the Apibot documentation.

If you want to write an Apibot extension, you may license it under any license you like, including a commercial one. However, keep in mind that if this is not a free software / open source license, your extension cannot be distributed freely with Apibot. (This problem is created by the non-free license, not by the Apibot one.)

Also, please try to stick to the Apibot coding / documenting conventions. For example, put your extension into a intuitively named subpath of the extensions/ path.

May I offer my code for inclusion in the Apibot standard code

Of course. Write it well, license it properly and send it to Grigor (grigor at the site gatchev dot info). Your chances are good. :-)

Writing some user and programmer documentation on your code helps, too.

The copyright on your code / documentation remains yours, and you are welcome to mention that in the code / docs header, much like that is mentioned in the current Apibot code / docs.


I heard of other thing called Apibot...

Sure, the name is not registered or patented. :-) There is a game bot by Darkorbit and a robot that translates normal speech into API calls, and maybe more things with the same name. I do not pretend to own the name, to my best knowledge they don't too.