CIA Bot Notifier


Related Links
MediaWiki port derived from this initial implementation


About the CIA Bot Notifier

This code is experimental code that takes advantage of the very popular IRC-based source code change notifier bot, CIA. Basically, changes to your wiki pages, or new comments, generate an XML-formatted message that is sent to the CIA bot server. The message is then re-broadcast over IRC channels via subscribed CIA bots. Details about CIA are beyond the scope of this document; those interested in additional information about the XML schema used in this code should start with the CIA development docs.

Screenshot

This is what the notifier looks like in action using the irssi IRC client:

Screenshot of CIA notifier

System Requirements


Implementation

'cia_bot_project_name' => 'your-project-name'


                    // Notify CIA bot if config param is set
                    if(isset($this->config['cia_bot_project_name']) &&
                       !preg_match('/[!]\*/', $this->ACLs['read_acl']))
                    {
                        $project_name = $this->config['cia_bot_project_name'];
                        $to = 'cia@cia.vc';
                        $subject = 'DeliverXML';
                        $user = $this->GetUserName();
                        $href = $this->Href('', $this->tag);
                        $xml = <<<EOT
<message>
    <generator>
        <name>WikkaWiki custom mod</name>
        <version>0.01<version>
    </generator>
    <source>
        <project>$project_name</project>
    </source>
    <body>
        <commit>
            <log>Page modified: $href</log>
            <url>http://your-wiki-site-URL/$this->tag</url>
            <author>$user</author>
        </commit>
    </body>
</message>
EOT
;
                        mail($to, $subject, $xml);
                    }


                    // Notify CIA bot if config param is set
                    if(isset($this->config['cia_bot_project_name']))
                    {
                        $project_name = $this->config['cia_bot_project_name'];
                        $to = 'cia@cia.vc';
                        $subject = 'DeliverXML';
                        $user = $this->GetUserName();
                        $href = $this->Href('', $this->tag);
                        $xml = <<<EOT
<message>
    <generator>
        <name>WikkaWiki custom mod</name>
        <version>0.01<version>
    </generator>
    <source>
        <project>$project_name</project>
    </source>
    <body>
        <commit>
            <log>Comment modified: $href</log>
            <url>http://your-wiki-site-URL/$this->tag</url>
            <author>$user</author>
        </commit>
    </body>
</message>
EOT
;
                        mail($to, $subject, $xml);
                    }
There is one comment on this page. [Display comment]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki