Skip to content

Instantly share code, notes, and snippets.

@babie
Last active December 26, 2015 12:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save babie/7155110 to your computer and use it in GitHub Desktop.
Save babie/7155110 to your computer and use it in GitHub Desktop.
module TwitterOAuth
class Client
def update_profile(params)
post("/account/update_profile.json", params)
end
end
end
Earthquake.init do
%w[name description url location].each do |word|
command word.to_sym do
user = twitter.show(twitter.info["screen_name"])
if user.key?("error")
user = twitter.status(twitter.info["screen_name"])["user"] || {}
end
ap user.slice(word)
end
help word.to_sym, "show user #{word}"
command "update_#{word}".to_sym do |m|
text = _eval_as_ruby_string(m[1])
async_e { twitter.update_profile word.to_sym => text } if confirm("update #{word} '#{text}'")
end
help ":update_#{word}", "update user #{word}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment