User:Cyberbot I/Source/Alternative Music

The following post was automatically generated by Cyberbot I.

&lt;?PHP

while( $month == &quot;&quot; ) { echo &quot;What month is this newsletter?\n&quot;; $month = trim(fgets(STDIN)); }

include '/home/cyberpower678/wikibot.classes.php';

$wpq = new wikipediaquery; $wpapi = new wikipediaapi; $wpi = new wikipediaindex; $user = &quot;Cyberbot I&quot;; $pass = file_get_contents('/home/cyberpower678/.password'); $wpapi-&gt;login($user,$pass);

if( !preg_match( '/(enable|yes|run|go|start)/i', $wpq-&gt;getpage(&quot;User:Cyberbot I/Run/Newsletter&quot;) ) ) { die( &quot;Bot is disabled.\n&quot; ); }

if( $argv[2] != &quot;--nosource&quot; ) { $wpi-&gt;forcepost(		'User:'.$user.'/Source/Alternative Music',		'The following post was automatically generated by '.$user.&quot;.\n\n&lt;pre&gt;&quot; .		htmlentities(file_get_contents(__FILE__)) . 		&quot;&lt;/pre&gt;&quot;,		'Automatic source code upload (BOT)'	); }

//$month = &quot;March&quot;; //$links = &quot;User:X!/WPAM&quot;; $temp = &quot;Wikipedia:WikiProject Alternative music/Newsletter/$month 2009&quot;; $summary = &quot;Delivering newsletter. (BOT EDIT)&quot;;

$members = $wpq-&gt;getpage(&quot;Wikipedia:WikiProject Alternative music/Members&quot;); preg_match_all('/\{\{user\|(.*?)\}\}/i', $members, $mems); $mems = $mems[1];

$nolink = $wpq-&gt;getpage(&quot;Wikipedia:WikiProject Alternative music/Newsletter&quot;); preg_match_all('/\&lt;!-- (no|only)link: (.*?) --\&gt;/', $nolink, $nol); $nol = $nol[2];

$f = array; foreach( $mems as $fin ) { $fin = str_replace( &quot;_&quot;, &quot; &quot;, $fin ); $fin = ucfirst($fin); $f[] = $fin; }

foreach( $f as $val =&gt; $fi ) { if( in_array( $fi, $nol ) ) { unset( $f[$val] ); } } print_r($f);

preg_match_all('/\&lt;!-- onlylink: (.*?) --\&gt;/', $nolink, $ol); $ol = $ol[1]; foreach ($f as $data) { echo &quot;Posting notice to &quot;.$data.&quot;\n&quot;; $talk = $wpq-&gt;getpage(&quot;User talk:&quot;.$data); $write = $talk.&quot;\n== WikiProject Alternative Music Newsletter for $month 2009 ==\n\n~&quot;;

$wpi-&gt;post(&quot;User talk:&quot;.$data, $write, $summary, false, null, false); }

foreach ($ol as $data) { echo &quot;Posting link to &quot;.$data.&quot;\n&quot;; $talk = $wpq-&gt;getpage(&quot;User talk:&quot;.$data); $write = $talk.&quot;\n== WikiProject Alternative Music Newsletter for $month 2009 ==\n The WikiProject Alternative Music Newsletter for $month 2009 has been released, you can view it here.\n~&quot;;

$wpi-&gt;post(&quot;User talk:&quot;.$data, $write, $summary, false, null, false); }

?&gt;