Bureaucrats, checkuser, Interface administrators, interwiki, Administrators (Semantic MediaWiki), Curators (Semantic MediaWiki), Editors (Semantic MediaWiki), staff, Suppressors, Administrators
83,693
edits
Zhuyifei1999 (talk | contribs) m (Zhuyifei1999 moved page WikiIndex:ChangeWikiaEngine.php to User:LeucosticteBot/ChangeWikiaEngine.php: Belong to user) |
Hoof Hearted (talk | contribs) m (minor tweaks) |
||
| Line 1: | Line 1: | ||
This bot looks for pages that have a url with .wikia.com in them, and changes the wiki engine to | This bot script looks for pages that have a url with <tt>.wikia.com</tt> in them, and changes the wiki engine to Wikia. It iterates over the list of pages contained in CategoryMembers.txt. See [[mw:Manual:Chris G's botclasses/AllCategoryMembersBot.php]] for details on generating that file. | ||
<pre> | <pre> | ||
| Line 5: | Line 5: | ||
/* | /* | ||
* ChangeWikiaEngine.php | * ChangeWikiaEngine.php | ||
* By Leucosticte, https://www. | * By Leucosticte, https://www.MediaWiki.org/wiki/User:Leucosticte | ||
* GPL 2.0 | * GPL 2.0 | ||
* | * | ||
* This bot looks for pages that have a url with .wikia.com in them, and changes the wiki engine to | * This bot looks for pages that have a url with .wikia.com in them, and changes the wiki engine to | ||
* | * Wikia. | ||
/* | /* | ||
/* Setup my classes. */ | /* Setup my classes. */ | ||
include( 'botclasses.php' ); | include( 'botclasses.php' ); | ||
$wiki = | $wiki = WikiIndex; | ||
$wiki->url = " | $wiki->url = "https://WikiIndex.org/api.php"; | ||
/* All the login stuff. */ | /* All the login stuff. */ | ||
| Line 41: | Line 41: | ||
// Poll to get wiki page content | // Poll to get wiki page content | ||
$contents = $wiki->getpage ( $line ); | $contents = $wiki->getpage ( $line ); | ||
// A template line with data will start with a |, e.g. |URL = | // A template line with data will start with a |, e.g. |URL = WikiIndex.org | ||
if ( $begin = strpos ( $contents, '|URL' ) ) { | if ( $begin = strpos ( $contents, '|URL' ) ) { | ||
if ( $equals = strpos ( $contents, '=', $begin ) ) { | if ( $equals = strpos ( $contents, '=', $begin ) ) { | ||
edits