++ed by:
NQOUNET EGOR ADAMJS

3 PAUSE users
2 non-PAUSE users.

Tatsuhiko Miyagawa

NAME

AnyEvent::Twitter::Stream - Receive Twitter streaming API in an event loop

SYNOPSIS

  use AnyEvent::Twitter::Stream;

  # receive updates from @following_ids
  my $listener = AnyEvent::Twitter::Stream->new(
      username => $user,
      password => $password,
      method   => "filter",  # "firehose" for everything, "sample" for sample timeline
      follow   => join(",", @following_ids),
      on_tweet => sub {
          my $tweet = shift;
          warn "$tweet->{user}{screen_name}: $tweet->{text}\n";
      },
      on_keepalive => sub {
          warn "ping\n";
      },
      timeout => 45,
  );

  # track keywords
  my $guard = AnyEvent::Twitter::Stream->new(
      username => $user,
      password => $password,
      method   => "filter",
      track    => "Perl,Test,Music",
      on_tweet => sub { },
  );

DESCRIPTION

AnyEvent::Twitter::Stream is an AnyEvent user to receive Twitter streaming API, available at http://apiwiki.twitter.com/Streaming-API-Documentation

See "track.pl" in eg for more client code example.

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

AnyEvent::Twitter, Net::Twitter::Stream