+sub follower_search {
+ # search follower's tweets containing keywords
+ # param => Net::Twitter::Lite object, keyword string, since_id
+ # ret => HashRef of status_id (timeline order is destroyed)
+ # or undef (none is found)
+
+ my $bot = shift @_;
+ my $keyword = shift @_;
+ my $since_id = shift @_ || 1;
+
+ my $tweets = or_search($bot, [ $keyword ], $since_id);
+ if (! $tweets) {
+ return {};
+ }
+
+ my $followers;
+ eval {
+ $followers = $bot->followers_ids();
+ VERBOSE and warn Dumper($followers);
+ };
+ if ($@) {
+ evalrescue($@);
+ }
+
+ my $ids = {};
+ foreach my $status_id (keys %$tweets) {
+ foreach my $user_id (@$followers) {
+ if ($tweets->{$status_id}{user_id} == $user_id) {
+ $ids->{$status_id} = $tweets->{$status_id};
+ last;
+ }
+ }
+ }
+
+ DEBUG and warn "search result in followers => ", Dumper($ids);
+ return $ids;
+}
+