Permalink
Browse files

handle argument as a status id and fetch the user from it when user n…

…ot found (#82)
  • Loading branch information...
1 parent a92c8ce commit 0199cf8bb446adff137f4c339bcc4b03f1a301e7 @no6v no6v committed Nov 29, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/earthquake/commands.rb
@@ -189,7 +189,11 @@
HELP
command :user do |m|
- ap twitter.show(m[1]).slice(*%w(id screen_name name profile_image_url description url location time_zone lang protected))
+ user = twitter.show(m[1])
+ if user.key?("error")
+ user = twitter.status(m[1])["user"] || {}
+ end
+ ap user.slice(*%w(id screen_name name profile_image_url description url location time_zone lang protected))
end
help :user, "show user info"

0 comments on commit 0199cf8

Please sign in to comment.