api - Using cURL command with Ruby? -
want scrape bunch of tweets via twitter api, output curl command, that
curl --get 'https://api.twitter.com/1.1/search/tweets.json' --data 'q=football' --header      'authorization: oauth oauth_consumer_key="**hidden**", oauth_nonce="**hidden**", oauth_signature="**hidden**", oauth_signature_method="hmac-sha1", oauth_timestamp="**hidden**", oauth_token="**hidden**", oauth_version="1.0"' --verbose my question, there way use command ruby script scrape tweets ?
using twitter gem available here http://rdoc.info/gems/twitter following code can tweets ruby script.
require 'twitter'  client = twitter::rest::client.new |config|     config.consumer_key        ="hidden"     config.consumer_secret     ="hidden"     config.access_token        ="hidden"     config.access_token_secret ="hidden" end  client.search("football").collect |tweet|     puts tweet.text end 
Comments
Post a Comment