项目作者: underscorre

项目描述 :
Simple MediaWiki bot that replaces transclusions of templates with substitutions
高级语言: PHP
项目地址: git://github.com/underscorre/transclusion-bot.git
创建时间: 2016-11-06T17:25:41Z
项目社区:https://github.com/underscorre/transclusion-bot

开源协议:Other

下载


TransclusionBot

TransclusionBot is a simple MediaWiki bot that replaces transclusions of
templates with substitutions. Please note, the bot is only tested on Ubuntu
14.04 & PHP 7.0.13, and may not work on other distros/Operating Systems.

Install

You will need Composer installed on your system to
install the dependencies.

  1. > git clone https://github.com/underscorre/transclusion-bot
  2. > cd transclusion-bot
  3. > composer install

Usage

Once you’ve got a copy of the code, cd into the TransclusionBot folder and
run:

  1. > php bot.php -w http://example.com/api.php -t Example

The script takes two required arguments:

-w, —wiki

Specifies the location of the ‘api.php’ on the wiki the bot should edit on. So,
if you wanted to edit on the English Wikipedia, you would give
https://en.wikipedia.org/w/api.php as the --wiki argument.

-t, —template

Specifies the template that should be replaced. Do not include the “Template:”
portion of the template’s name, just what you’d normally type in when
transcluding the template. So, if you wanted to replace instances of a template
called Template:Delete, you would give Delete as the --template argument.

Specifying Username/Password

When the script is run with the correct usage, you will be asked to enter a
username/password. To edit anonymously, just press enter when asked for a
username.

Forcing Bot Rights

If you want to require that the account editing has bot rights, you can pass the
-b or --forcebot flag, which will cause the script to exit if the account
does not have bot rights.