Closed (won't fix)
Project:
Bot
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2008 at 03:08 UTC
Updated:
6 Feb 2009 at 16:53 UTC
function bot_nowpublic_irc_bot_cron() {
$pdo = new PDO('sqlite:/home/trac/nowpublic/db/trac.db');
$statement = $pdo->prepare('SELECT id, reporter, summary, priority, owner FROM ticket WHERE time > :time');
$statement->execute(array(':time' => time() - 300));
foreach ($statement as $ticket) {
extract($ticket);
$message = "New $priority ticket from $reporter for $owner: $summary https://TRACURL/ticket/$id";
bot_message('#nowpublic', $message);
}
}
edit: I removed the tracurl from the post. Opsie.
interested in this feature? then take the above code and make it nice and configurable. It requires PHP 5.2 but it does work for me.
Comments
Comment #1
morbus iffI believe this would be more cleanly handled via aggregator.module integration. See http://drupal.org/node/290761. You won't be able to customize the output as you'd like it, however. See http://trac.edgewall.org/query?status=new&format=rss&col=id&col=summary&... for one example of how you could get "new tickets, sorted by ascending creation date".
I'm not sure I want to code something *specific* for new issues... Thoughts?
Comment #2
aj045 commentedSo there'd be some sort of anti-spam, aggregation feature which would collate the most recent posts and then send them to the IRC in a list like format? sounds kinda cool.
Comment #3
morbus iffClosing, per discussion with chx.
aj045: yep, pretty much :)