Skip to content

Instantly share code, notes, and snippets.

@sugyan
Created April 21, 2010 09:05
Show Gist options
  • Save sugyan/373599 to your computer and use it in GitHub Desktop.
Save sugyan/373599 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent::Twitter::Stream;
use Config::Pit 'pit_get';
my $config = pit_get(
"twitter.com",
require => {
"username" => "your username on Twitter",
"password" => "your password on Twitter",
}
);
my $cv = AE::cv;
my $tw = AnyEvent::Twitter::Stream->new(
%$config,
track => '#perlcasual',
method => 'filter',
on_tweet => sub {
my $tweet = shift;
my $message = "\@$tweet->{user}{screen_name}: $tweet->{text}";
qx{ growlnotify -m "$message" };
}
);
$cv->recv;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment