* fix search query does not return user/screen_name and user/name
authormitty <mitty@7d2118f6-f56c-43e7-95a2-4bb3031d96e7>
Sun, 23 Sep 2012 03:40:42 +0000 (03:40 +0000)
committermitty <mitty@7d2118f6-f56c-43e7-95a2-4bb3031d96e7>
Sun, 23 Sep 2012 03:40:42 +0000 (03:40 +0000)
 * use from_user and from_user_name instead

git-svn-id: https://lab.mitty.jp/svn/lab/trunk@165 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

Dev/twitter/dump_timeline.pl

index 0564d5d..e800ac7 100755 (executable)
@@ -98,8 +98,11 @@ eval {
             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//;