Sonic.net updates via Twitter

Get updates about your favorite ISP from Twitter; just send “follow sonicnet” from your favorite Twitter device. You can check out the sonicnet page to see what you’ll be getting.

The code for this is made possible by the Net::Twitter Perl module.

#!/usr/bin/perl
use strict;
use warnings;
use Net::Twitter;
my $message = "Super Duper";
my $twit = Net::Twitter->new(username=>"sonicnet", password=>"password" );
$twit->update($message);

Pretty easy huh?

This entry was posted in General, work and tagged . Bookmark the permalink.

3 Responses to Sonic.net updates via Twitter

  1. Eric says:

    You need a little more code.

    Funny truncated messages that chop off in the middle of words and make me wonder where to find out more…

    I think simply sticking a URL (preferably shortened with something like WWW::Shorten::Metamark) at the start would be a good start…

    Tacking it onto the end’s a little more complicated…

    use WWW::Shorten::Metamark;
    my $short_url = makeashorterlink($long_url);
    $final_message = substr($message,0,160 – length($short_url) – 1)) . ‘ ‘ . $short_url;
    $twit->update($message);

  2. Eric says:

    Err, s/160/140/;

  3. augie says:

    160 characters is the SMS standard, Twitter shortens that to 140 for padding and user names; you can find out more by checking out the Official Twitter API page here:

    http://groups.google.com/group/twitter-development-talk/web/api-documentation

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>