X-Git-Url: http://lab.mitty.jp/git/?a=blobdiff_plain;f=Dev%2Ftwitter%2Ftwitterbot.pl;h=bb7baa0b9e82de0e999e85f12e215bd5bfaad1c3;hb=bf1a1eab8ab75f495c2d81fae907bed6a071ffae;hp=f9dea40084f8a0d6617f48e2d8efd1f9dd75db84;hpb=45a20c35b7f63730b2bd6d7253d7b9aa07df68c2;p=lab.git diff --git a/Dev/twitter/twitterbot.pl b/Dev/twitter/twitterbot.pl index f9dea40..bb7baa0 100755 --- a/Dev/twitter/twitterbot.pl +++ b/Dev/twitter/twitterbot.pl @@ -106,6 +106,7 @@ foreach my $id (sort keys %$tweets) { } if ($skip) { + $stat->{$tweets->{$id}{type}} = $id; next; } @@ -142,7 +143,7 @@ if ($conf->{mail}{body}) { DEBUG or sendmail(%mail) or warn "Error sending mail: $Mail::Sendmail::error\n"; } -if ($tweets) { +if (ref $tweets and keys %{$tweets}) { # save last status to yaml file DEBUG or YAML::Tiny::DumpFile("$Bin/status.yml", $stat); DEBUG and warn "status.yml => ", Dumper($stat); @@ -177,6 +178,7 @@ sub login { my $bot = Net::Twitter::Lite->new( consumer_key => $conf->{consumer_key}, consumer_secret => $conf->{consumer_secret}, + legacy_lists_api => 0, ); $bot->access_token($conf->{access_token});