Last active
December 26, 2015 12:59
-
-
Save babie/7155110 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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