User:Addbot/Source
The following is automatically generated by Addbot.
Bot (bot.addbot.php)
<? //From http://toolserver.org/~chris/highlight.php?d=chris/classes/&f=botclasses.php require 'bot.classes.php'; $wiki = new wikipedia; $wiki->url = 'http://en.wikipedia.org/w/api.php'; global $wiki; $user = "Addbot"; $owner = "Addshore"; require 'bot.password.php'; $wiki->login($user,$pass); echo "USER: Logged In!\n"; unset($pass); ?>
Talksubst Bot
talksubst/run.php
<?PHP
require '../bot.addbot.php';
//Get the list of templates and strip away the rubbish
$awbutt = explode('expand the template(s) on the user talk page.',$wiki->getpage('Wikipedia:AutoWikiBrowser/User_talk_templates'));
$awbutt = str_ireplace(']]','',str_ireplace('# [[','',str_ireplace(']]# [[','|',ereg_replace ("\n",'',$awbutt[1]))));
//$awbutt = str_ireplace('<noinclude>{{pp-semi-protected|small=yes}}</noinclude>{{AWB}}{{shortcut|WP:AWB/UTT}}This page contains templates that AWB will automatically substitute on user talk pages as part of the AWB general fixes. Please make sure that general fixes are enabled, and this will be done when processing user talk pages. The MediaWiki API is used to automatically substitute and expand the template(s) on the user talk page.).','',$awbutt);
$awbutt = explode('|',$awbutt);
//check each template
foreach ($awbutt as $template)
{
//Get the pages the template is found on
$pages = $wiki->getTransclusions($template);
foreach ($pages as $page)
{
//If it is a user talk page and is not a sub page
if ( (strpos($page,"User talk:") !== FALSE) && (strpos($page,"/") === FALSE) )
{
//Get the content and try to subst the template
$content = $wiki->getpage($page);
$content = str_ireplace("{{".$template,"{{subst:".$template,$content);
$content = str_ireplace("{{".str_replace("Template:","",$template),"{{subst:".$template,$content);
echo "$page\n\r";
$wiki->edit($page,$content,"[[User:Addbot|Bot:]] Substing template $template",true);
}
}
}
?>
Sandbox Bot
sandbox/run_clean.php
<?PHP
require '../bot.addbot.php';
require 'sandboxes.php';
global $wiki;
//Check all of the content sets
for ($i = 1; $i <= count($sandbox); $i++) {
//And check each page for this content
for ($j = 1; $j <= (count($sandbox[$i])-1); $j++) {
$page = $sandbox[$i][$j];
$content = $sandbox[$i][0];
if ($wiki->getpage($page) == $content)
{
$wiki->edit($page,$content,"[[User:Addbot|Bot:]] Restoring $page",true);
}
}
}
?>
sandbox/run_header.php
<?PHP
require '../bot.addbot.php';
require 'sandboxes.php';
global $wiki;
//Check all of the content sets
for ($i = 1; $i <= count($sandbox); $i++) {
//And check each page for this content
for ($j = 1; $j <= (count($sandbox[$i])-1); $j++) {
$page = $sandbox[$i][$j];
$content = $sandbox[$i][0];
if (strpos($wiki->getpage($page),$content) === FALSE) {
$wiki->edit($page,$content,"[[User:Addbot|Bot:]] Restoring $page header",true);
}
}
}
?>
sandbox/sandboxes.php
<?
//Sandboxes
$sandbox[1][0] = "{{Please leave this line alone (sandbox heading)}}\n<!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->";
$sandbox[1][1] = 'Wikipedia:Sandbox';
$sandbox[2][0] = "{{Please leave this line alone (sandbox talk heading)}}\n<!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->";
$sandbox[2][1] = 'Wikipedia_talk:Sandbox';
$sandbox[3][0] = "{{Please leave this line alone (tutorial sandbox heading)}}\n<!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->";
$sandbox[3][1] = 'Wikipedia:Tutorial (Editing)/sandbox';
$sandbox[3][2] = 'Wikipedia:Tutorial (Formatting)/sandbox';
$sandbox[3][3] = 'Wikipedia:Tutorial (Wikipedia links)/sandbox';
$sandbox[3][4] = 'Wikipedia:Tutorial (Citing sources)/sandbox';
$sandbox[3][5] = 'Wikipedia:Tutorial (Keep in mind)/sandbox';
$sandbox[4][0] = "{{Please leave this line alone (sandbox talk heading)}}\n<!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->";
for($i = 1; $i <= 9; $i++){
$sandbox[4][$i] = "Template_talk:X$i";
}
$sandbox[4][10] = 'Wikipedia talk:Tutorial/Editing/sandbox';
$sandbox[4][11] = 'Wikipedia talk:Tutorial/Formatting/sandbox';
$sandbox[4][12] = 'Wikipedia talk:Tutorial/Wikipedia links/sandbox';
$sandbox[4][13] = 'Wikipedia talk:Tutorial/Citing sources/sandbox';
$sandbox[4][14] = 'Wikipedia talk:Tutorial/Keep in mind/sandbox';
$sandbox[5][0] = "<noinclude>\nThis sandbox is itself a template. This sandbox is for experimenting with templates.\n{{Please leave this line alone (template sandbox heading)}}\n</noinclude>\n\nIf you defined parameters such as <tt><nowiki>{{Template sandbox|First|Second|name=\"Named\"}}</nowiki></tt>:\n;First:{{{1}}}\n;Second:{{{2}}}\n;Name:{{{name}}}\n\n----";
$sandbox[5][1] = 'Template:Template sandbox';
$sandbox[6][0] = "<noinclude>\nThis sandbox is itself a template. This sandbox is for experimenting with templates.\n{{Please leave this line alone (template sandbox heading)}}\n</noinclude>\n\nIf you defined parameters such as <tt><nowiki>{{Template sandbox|First|Second|name=\"Named\"}}</nowiki></tt>:\n;First:{{{1}}}\n;Second:{{{2}}}\n;Name:{{{name}}}\n\n----\n<!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->";
for($i = 1; $i <= 9; $i++){
$sandbox[6][$i] = "Template:X$i";
}
?>
Sourcecode Bot
sourcecode/run.php
<?
require '../bot.addbot.php';
$wiki->edit('User:'.$user.'/Source',
'The following is automatically generated by [[User:'.$user.'|'.$user."]].\n\n\n".
//"==Classes (bot.classes.php)==\n\n<pre>".htmlentities(file_get_contents('../bot.classes.php'))."</pre>\n\n\n".
"==Bot (bot.addbot.php)==\n\n".'<pre>'.htmlentities(file_get_contents('../bot.addbot.php'))."</pre>\n\n\n".
"==Talksubst Bot==\n\n".
"===talksubst/run.php===\n\n<pre>".htmlentities(file_get_contents('../talksubst/run.php'))."</pre>\n\n\n".
"==Sandbox Bot==\n\n".
"===sandbox/run_clean.php===\n\n<pre>".htmlentities(file_get_contents('../sandbox/run_clean.php'))."</pre>\n\n\n".
"===sandbox/run_header.php===\n\n<pre>".htmlentities(file_get_contents('../sandbox/run_header.php'))."</pre>\n\n\n".
"===sandbox/sandboxes.php===\n\n<pre>".htmlentities(file_get_contents('../sandbox/sandboxes.php'))."</pre>\n\n\n".
"==Sourcecode Bot==\n\n".
"===sourcecode/run.php===\n\n<pre>".htmlentities(file_get_contents('run.php'))."</pre>\n\n\n"
,'[[User:Addbot|BOT:]] Automated source upload');
?>
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.