[Mediawiki-l] Wikinotify configuration?

Bill Traynor wmat at naoi.ca
Tue Jul 21 19:54:06 UTC 2009


I'd like to push wiki changes to an IRC channel (#elinux) on freenode
and I can't seem to get Wikinotify working.  The documentation
indicates to set three variables, which I've set to:

$psyctarget = "irc://freenode.net/elinux";
$psychost = "udp://freenode.net";
$psycport = 4404;

Am I missing something?

Thanks
Bill


The full psychnotify.php looks like this:

$psyctarget = "irc://freenode.net/elinux";
$psychost = "udp://freenode.net";
$psycport = 4404;

/* in an ideal world, there is nothing you need to do below here */

function psycnotify($article, $user, $text, $summary, $isminor,
$iswatch, $section) {
   global $psyctarget, $psychost;

   $url = "http://" . $_SERVER['SERVER_NAME'];
   $url .= str_replace("index.php?title=", "index.php/",
      substr($_SERVER['REQUEST_URI'], 0, -14));
   # header
   $s = ":_target\t$psyctarget\n"
#      . ":_encoding\tutf-8\n" # PSYC uses UTF-8 anyway
      . "\n"                  # move on from routing layer to application layer
      . ":_nick_wiki\t". strToLower($user->mName) ."\n"
      . ":_article\t". $article->mTitle->mTextform ."\n"
      . ":_page\t$url$section\n";
   if ($section) {
       $s .= ":_section\t$section\n";
       if ($summary && ($p = strpos($summary, " */ ")))
           $summary = substr($summary, $p + 4);
   }
   if ($summary) $s .= ":_summary\t$summary\n";

   # method
   $mc = "_notice_update_wiki";
   if ($isminor) $mc .= "_minor";
   $s .= $mc ."\n";

   # body
   $s .= "(Wiki:[_nick_wiki]) has made a "
      . ($isminor ? "minor" : "major")
      . " change in [_page]\n";
   if ($summary) $s .= "saying: [_summary]\n";

   # deliver, as simple as that
   $udp = fsockopen($psychost, $psycport);
   fwrite($udp, ".\n". $s .".\n");
   fclose($udp);
   return true;
}

$wgHooks['ArticleSaveComplete'][] = array('psycnotify');



More information about the MediaWiki-l mailing list