- Timestamp:
- Oct 4, 2010 9:56:16 PM (14 years ago)
- Branches:
- master, trunk
- Children:
- f3ef4f6
- Parents:
- d732ebc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
twitter/twitterbot.pl
rac68e58 r139622c 13 13 use FindBin qw($Bin); 14 14 use YAML::Tiny; 15 use Date::Parse qw(str2time); 15 16 16 17 sub VERBOSE () { $ARGV[0] eq 'verbose' }; … … 143 144 ); 144 145 } 146 VERBOSE and warn Dumper($res); 145 147 if ($res->{results}) { 146 VERBOSE and warn Dumper($res);147 148 foreach my $tweet (@{$res->{results}}) { 148 149 my $res = $bot->show_status($tweet->{id}); 150 VERBOSE and warn Dumper($res); 151 152 my $id = { 153 date => str2time($res->{created_at}), 154 screen_name => $res->{user}{screen_name}, 155 status_id => $res->{id}, 156 text => $res->{text}, 157 }; 149 158 if ($res->{retweeted_status}) { 150 $id s->{$tweet->{id}}{type} = 'retweet';159 $id->{type} = 'retweet'; 151 160 } 152 161 else { 153 $id s->{$tweet->{id}}{type} = 'search';154 } 155 VERBOSE and warn Dumper($res);162 $id->{type} = 'search'; 163 } 164 $ids->{$tweet->{id}} = $id; 156 165 } 157 166 } … … 192 201 map { 193 202 $_->{id} => { 194 type => 'mention', 203 date => str2time($_->{created_at}), 204 screen_name => $_->{user}{screen_name}, 205 status_id => $_->{id}, 206 text => $_->{text}, 207 type => 'mention', 195 208 } 196 209 } @{$res}
Note: See TracChangeset
for help on using the changeset viewer.