Skip to content

Instantly share code, notes, and snippets.

@JayK31
Created July 11, 2014 14:03
Show Gist options
  • Save JayK31/29f296ef82e0a2fd0208 to your computer and use it in GitHub Desktop.
Save JayK31/29f296ef82e0a2fd0208 to your computer and use it in GitHub Desktop.
def search
result = HTTParty.get("https://api.twitter.com/1.1/search/tweets.json",
:query => { 'q' => self.name },
:headers => {
'Authorization' => "Bearer #{ENV['TWIT']}"
})
result_body = result.body
json_result_body = JSON.parse(result_body)
statuses = json_result_body["statuses"]
texts = statuses.map { |status| status["text"]}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment