User:SoxBot II/Source

The following is automatically generated by SoxBot II.


 * wikibot.classes.php is here.

Source to SoxBot II
&lt;?PHP include '../Cluebot2/wikibot.classes.php'; include '../Cluebot2/cluebot2.config.php'; $wpq = new wikipediaquery; $wpapi = new wikipediaapi; $wpi = new wikipediaindex;

$wpapi-&gt;login($user,$pass); $wpi-&gt;forcepost('User:'.$user.'/Source',&quot;The following is automatically generated by User:&quot;.$user.&quot;.\n\n\n\n* wikibot.classes.php is here.\n\n\n\n==Source to &quot;.$user.&quot;==\n\n&lt;pre&gt;&quot;.htmlentities(file_get_contents(__FILE__)).&quot;&lt;/pre&gt;\n\n\n\n&quot;,'Automated source upload.'); /* Our source code, we force post this because this is *our* page, and it triggers the nobots. */

$text = $wpq-&gt;getpage('Wikipedia:Requests for adminship'); $result = array; foreach (array(adminship,bureaucratship) as $rfx) { preg_match_all('/\{\{Wikipedia\:Requests for '.$rfx.'\/(.*)\}\}/', $text, $r); unset($r[1]); if ($rfx == 'adminship') { unset($r[0][0]); array_pop($r[0]); }					print_r($r); $count = '0'; foreach ($r[0] as $data) { $count = $count + 1; }					$month = array(4=&gt;0,5=&gt;1,6=&gt;2,7=&gt;3,8=&gt;4,9=&gt;5,10=&gt;6,11=&gt;7,12=&gt;8,1=&gt;9,2=&gt;10,3=&gt;11); $days = array(28=&gt;8.6,29=&gt;8.3,30=&gt;8,31=&gt;7.7); $out = (240*$month[date(&quot;n&quot;)])+(date(&quot;j&quot;)*($days[date(&quot;t&quot;)])).&quot;,&quot;.($count * 50); echo $out.&quot;\n&quot;; array_push($result, $out); }				print_r($result); $code = $wpq-&gt;getpage('User:Soxred93/RfA Graph'); $code = str_replace(&quot;&lt;polyline stroke=\&quot;#4A7EBB\&quot; points=\&quot;&quot;, &quot;&lt;polyline stroke=\&quot;#4A7EBB\&quot; points=\&quot;\n&quot;.$result[0], $code); $code = str_replace(&quot;&lt;polyline stroke=\&quot;#BE4B48\&quot; points=\&quot;&quot;, &quot;&lt;polyline stroke=\&quot;#BE4B48\&quot; points=\&quot;\n&quot;.$result[1], $code); file_put_contents('../Cluebot2/Graph of RfA and RfB.svg', $code); if (date(&quot;w&quot;) == '3') { $wpi-&gt;upload('../Cluebot2/Graph of RfA and RfB.svg','/home/soxred93/Cluebot2/Graph of RfA and RfB.svg','Automated upload of graph'); }				$wpi-&gt;post('User:Soxred93/RfA Graph', $code, 'Posting the code for an SVG graph (BOT EDIT)'); ?&gt;

SoxBot II (talk)