* output string contains numeric character references
[lab.git] / Dev / twitter / twitterbot.pl
index 3923a6b..bb7baa0 100755 (executable)
@@ -143,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);
@@ -178,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});