X-Git-Url: http://lab.mitty.jp/git/?a=blobdiff_plain;f=Dev%2Ftwitter%2Fdump_timeline.pl;h=95385e44b73ab5beafb40a074d5015b2630faf83;hb=5fa546f5c2cf727d3ad1f9bf52f36d89c81597de;hp=82162879a883fc4a3fd077e2fd0daeba2cbf2577;hpb=fe7588333fde0d1dba7162596725ea5f269b68ab;p=lab.git diff --git a/Dev/twitter/dump_timeline.pl b/Dev/twitter/dump_timeline.pl index 8216287..95385e4 100755 --- a/Dev/twitter/dump_timeline.pl +++ b/Dev/twitter/dump_timeline.pl @@ -18,7 +18,7 @@ use Encode; my $help = sub { die <user_timeline($param); } - elsif ($method eq 'retweeted_by_me') { + elsif ($method eq 'retweeted_by_me' || $method eq 'r') { $res = $bot->retweeted_by_me($param); } - elsif ($method eq 'mentions') { + elsif ($method eq 'mentions' || $method eq 'm') { $res = $bot->mentions($param); } else { @@ -84,12 +84,12 @@ eval { else { foreach my $status (@{$res}) { my $text = ""; + $text .= "(". $status->{id} . ") "; $text .= $status->{user}{name}; $text .= " [" . $status->{created_at} . "]"; - $text .= " (". $status->{id} . ")"; - $text .= " ". encode('utf8', $status->{text}); + $text .= " ". $status->{text}; $text =~ s/\n//; - print $text, "\n"; + print encode('utf8', $text), "\n"; } } }