[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

how to use a package in Perl

Posted on 2010-09-14
9
Medium Priority
?
221 Views
Last Modified: 2013-11-10
Can anyone give me a clue about how to use this package in perl. I have not programmed in perl in about 8 years and I forget almost everything.

http://search.cpan.org/~miyagawa/AnyEvent-Twitter-Stream-0.16/lib/AnyEvent/Twitter/Stream.pm#SYNOPSIS
http://search.cpan.org/~miyagawa/AnyEvent-Twitter-Stream-0.16/lib/AnyEvent/Twitter/Stream.pm#SYNOPSIS

THANKS
0
Comment
Question by:onyourmark
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 10

Accepted Solution

by:
jeromee earned 2000 total points
ID: 33672659
onyourmark,
You should be able to use the example given in the synopsis of the CPAN page that you are referring to.
You just need to specify a user and password i.e. define $user and $password
0
 

Author Comment

by:onyourmark
ID: 33678192
Hi Thanks. I actually was having a little trouble figuring out which part is the example. Could you tell me which part is the example?
0
 

Author Comment

by:onyourmark
ID: 33679001
Hello. I tried the following code (the example). It says the ... on line 18 and on line 40 are producing errors. What do I do with those?
Also, where do I enter the username and password?
Thanks.




 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";
      },
      on_delete => sub {
          my ($tweet_id, $user_id) = @_; # callback executed when twitter send a delete notification
          ...
      },
      timeout => 45,
  );

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

  # to use OAuth authentication
  my $listener = AnyEvent::Twitter::Stream->new(
      consumer_key    => $consumer_key,
      consumer_secret => $consumer_secret,
      token           => $token,
      token_secret    => $token_secret,
      method          => "filter",
      track           => "...",
      on_tweet        => sub { ... },
  );
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 84

Expert Comment

by:ozo
ID: 33679468
the ... is meant to be filled in with your own code.
what do you want to do with the twitter stream?
0
 

Author Comment

by:onyourmark
ID: 33679683
just download it to csv files (continuously but the first step is just to download something). Thanks.
0
 
LVL 10

Expert Comment

by:jeromee
ID: 33682606
But do you want to follow someone (someones...) or track some keywords?
0
 

Author Comment

by:onyourmark
ID: 33682687
no. I wanted to download all the tweets. do you know if this module can do that?
0
 
LVL 10

Expert Comment

by:jeromee
ID: 33683115
According to this article: http://www.businessinsider.com/twitter-stats-2010-4#twitters-users-are-doing-55-million-tweets-per-day-6 in Apr 2010, there was 55 millions tweets a day... are you really considering getting that many tweets.
I'm not even sure it's allowed to subscribe to all.
0
 

Author Comment

by:onyourmark
ID: 33685364
Hi. It is allowed to download 5% and that is what I was trying eventually to do but I don't know if this module assists with that or not.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question