Created
June 18, 2013 08:22
-
-
Save fovtran/5803576 to your computer and use it in GitHub Desktop.
REST v1.1 Twitter API 1st Status reader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# REST v1.1 Twitter API 1st Status reader | |
# DMC2013 | |
# License: LGPL | |
# | |
use Net::Twitter; | |
use Scalar::Util 'blessed'; | |
my $consumer_key = ""; | |
my $consumer_secret = ""; | |
my $token = ""; | |
my $token_secret = ""; | |
my $high_water = "fovtran"; | |
my $nt = Net::Twitter->new(legacy => 0); | |
my $nt = Net::Twitter->new( | |
traits => [qw/OAuth API::RESTv1_1 WrapError/], | |
consumer_key => $consumer_key, | |
consumer_secret => $consumer_secret, | |
access_token => $token, | |
access_token_secret => $token_secret, | |
); | |
my @timeline; | |
print "Reading Statuse by Numbers\n"; | |
# my $cursor = -1, my $r; $cursor; $cursor = $r->{next_cursor} | |
my $statuses = $nt->user_timeline({ user_id => $high_water, count => 1 }); | |
for ( my $id = 1; $id =5; ++$id ) { | |
my $status = $nt->show_status({ id => $id }); | |
print $status->{text}; | |
push @timeline, $status->{text}; | |
} | |
print @timeline; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment