}
my $stat = loadconf("$Bin/status.yml");
if (! defined $stat) {
- $stat = {
- # do not set to 0
- since_id => 1,
- };
+ $stat = {};
}
my $bot = login($conf);
my %tweets;
my $tweet;
-$tweet = or_search($bot, $conf->{hashtag}, $stat->{since_id});
+$tweet = or_search($bot, $conf->{hashtag}, $stat->{search});
if ($tweet) {
%tweets = (%tweets, %$tweet);
}
-$tweet = mentions_ids($bot, $stat->{since_id});
+$tweet = mentions_ids($bot, $stat->{mention});
if ($tweet) {
%tweets = (%tweets, %$tweet);
}
next;
}
- $stat->{since_id} = $id;
+ $stat->{$tweets{$id}} = $id;
}
if (%tweets) {
my $bot = shift @_;
my $keywords = shift @_;
- my $since_id = shift @_;
+ my $since_id = shift @_ || 1;
my $key = "";
foreach my $word (@$keywords) {
# or undef (none is found)
my $bot = shift @_;
- my $since_id = shift @_;
+ my $since_id = shift @_ || 1;
my $res;
eval {