foreach my $status (@{$res}) {
my $text = "";
$text .= "(". $status->{id} . ") ";
- $text .= $status->{user}{screen_name} . "|";
- $text .= $status->{user}{name};
+ $text .= ($status->{user}{screen_name}) ?
+ $status->{user}{screen_name} : $status->{from_user};
+ $text .= "|";
+ $text .= ($status->{user}{name}) ?
+ $status->{user}{name} : $status->{from_user_name};
$text .= " [" . $status->{created_at} . "]";
$text .= " ". $status->{text};
$text =~ s/\n//;
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});