Guest User

Untitled

a guest
Apr 17th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4. use AnyEvent::Twitter::Stream;
  5. use Config::Pit;
  6.  
  7. my $config = pit_get("twitter.com");
  8.  
  9. my $cv = AnyEvent->condvar;
  10.  
  11. my $listenier = AnyEvent::Twitter::Stream->new(
  12. username => $config->{username},
  13. password => $config->{password},
  14. method => "filter",
  15. track => "perl,emacs",
  16. on_tweet => sub {
  17. my $tweet = shift;
  18. warn "$tweet->{user}{screen_name}: $tweet->{text}\n";
  19. },
  20. on_eof => $cv,
  21. );
  22. $cv->recv;
Add Comment
Please, Sign In to add comment