--- /dev/null
+#!/usr/bin/env php
+<?php
+
+require __DIR__."/../lib/btr/irc.php";
+
+if ($argc != 3) {
+ fatal("Usage: %s <url|fifo> <message>\n", basename($argv[0]));
+}
+
+if (isfifo($argv[1])) {
+ file_put_contents($argv[1], $argv[2]);
+} else {
+ $bot = new Client($argv[1], function($bot) {
+ $bot->send($_SERVER["argv"][2]);
+ });
+ $bot->getSession()->onNumeric = function($origin, $event) use ($bot) {
+ if ($event == \irc\client\RPL_ENDOFNAMES) {
+ $bot->getSession()->disconnect();
+ }
+ };
+ $bot->getSession()->run();
+}
+
+# vim: noet