Logins

From Apibot
Jump to: navigation, search

In order to work, Apibot needs to know some things about the wiki and the account it should use. The wiki data is described in wiki description structures. The account data is described in account structures.

Wiki description structure

It is a PHP array looking like this:

'name' => "English-language Wikipedia",  // the name the bot will use for this wiki
'urls' => array (  // URLs for the API and Web access scripts (PHP files)
  'api' => "http://en.wikipedia.org/w/api.php",
  'web' => "http://en.wikipedia.org/w/index.php",
),

The array may also include Apibot settings much like these in the common settings array. Settings in the wiki description will override the common ones.

Account structure

It is a PHP array looking like this:

'user'     => "MyOwnBot", // the account your bot uses
'password' => "MyOwnPassword",  // the password for the account your bot uses
'wiki'     => $en_wikipedia,    // the description structure for the wiki with this account

Of course, you can write the wiki description array directly as the 'wiki' value of the account array. However, if you bot uses different accounts on the same wiki (eg. for different tasks, or with different settings), it may be more convenient to define the wiki description as a variable and assign that to the 'wiki' key of the account array.