Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rjray (1649)

  (email not shown publicly)
AOL IM: rjrayperl (Add Buddy, Send Message)
Yahoo! ID: rjray_perl (Add User, Send Message)

Journal of rjray (1649)

Friday September 21, 2007
05:46 PM


[ #34518 ]

I have a (reasonably stable) Twitter-bot up and running. Like the existing "cpan" Twitter, it spools CPAN uploads to Twitter from the RDF that publishes. Unlike "cpan" (which was apparently shut-off a little over a month ago anyway), it provides links: The released package itself is linked, and behind the scenes the MANIFEST file is scanned for something matching /(changes|changelog|changelist)\b/i and if found is also linked. If no change-file is found, README is linked to instead (unless there's no README, in which case you just get the one link instead of two).

The bot polls the RDF URL every 15min or so, using an If-Modified-Since header. Any new CPAN uploads are queued up for posting to Twitter, spaced out evenly over the 15min waiting period (i.e., if there are two new CPAN uploads then tweet fires immediately and the second waits roughly 7.5 minutes to fire... fifteen new uploads would fire at roughly one-minute intervals) so that it doesn't suddenly spam your Twitter client.

This is still largely alpha, though the code itself is reasonably clean (one must love being borderline-OCD). I want to add better local logging, reading of direct messages to interpret them as commands, stats tracking, etc. to it yet. Also, I plan to abstract the overall architecture moreso than it currently is, and CPAN that as a Twitterbot sort of class/mini-framework. For that matter, the structure of the message that gets sent as a tweet is itself vulnerable to change yet, as I'm not 100% happy with it (but as far as I know, I can't use HTML for formatting, so I can't (for example) link the module name to the CPAN page, I can only send the URL in the message body and rely on clients like IM or Twitterific to hot-link the text).

For now, though, you can get your CPAN addiction fed via Twitter at:

(I'm also thinking about changing the name to "cpan_with_links". Alternately, if the current owner of the "cpan" Twitter account wants to talk, feel free to e-mail me.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Of all my friends, I would have voted you "least likely to make a Bambi reference in a journal." Nevertheless, it's currently the best reason I have to use Twitter.