* dir for Sakura Editor setting files
[lab.git] / twitter / twitterbot.pl
index d1dd229..406ee12 100755 (executable)
@@ -36,17 +36,14 @@ if (! $bot->authorized) {
 }
 
 my $tweets = {};
-my $tweet;
-
-$tweet = or_search($bot, $conf->{hashtag}, $stat->{search});
-if ($tweet) {
-    %$tweets = (%$tweets, %$tweet);
-}
-
-$tweet = mentions_ids($bot, $stat->{mention});
-if ($tweet) {
-    %$tweets = (%$tweets, %$tweet);
-}
+%$tweets = (
+    %$tweets,
+    %{ or_search($bot, $conf->{hashtag}, $stat->{search}) }
+);
+%$tweets = (
+    %$tweets,
+    %{ mentions_ids($bot, $stat->{mention}) }
+);
 
 foreach my $id (sort keys %$tweets) {
     # $tweets->{$id}{type} eq 'search'  => found by search API