Skip to content

@ahmdrefat /example2.rb secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# Applications that make requests on behalf of a single Twitter user can pass global configuration options as a block to the Twitter.configure method.
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
# After configuration, requests can be made like so:
Twitter.update("I'm tweeting with @gem!")
# Follow a user
Twitter.follow("ahmdrefat")
# Fetch a user
Twitter.user("ahmdrefat")
# User timeline
Twitter.user_timeline("ahmdrefat")
# Search
Twitter.search("to:ahmdrefat ruby on rails", :count => 5, :result_type => "recent").results.map do |status|
"#{status.from_user}: #{status.text}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.