Skip to content

Instantly share code, notes, and snippets.

@yaotti
Created October 7, 2009 11:20
Show Gist options
  • Save yaotti/203973 to your computer and use it in GitHub Desktop.
Save yaotti/203973 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Twitter::Stream;
use Config::Pit;
my $config = pit_get("twitter.com");
my $cv = AnyEvent->condvar;
my $listenier = AnyEvent::Twitter::Stream->new(
username => $config->{username},
password => $config->{password},
method => "filter",
track => "perl,emacs",
on_tweet => sub {
my $tweet = shift;
warn "$tweet->{user}{screen_name}: $tweet->{text}\n";
},
on_eof => $cv,
);
$cv->recv;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment