Last active
August 29, 2015 14:27
-
-
Save kirillzh/6b7d2d181ec730dbc912 to your computer and use it in GitHub Desktop.
Hot trends
This file contains 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
require 'typhoeus' | |
require 'json' | |
response = Typhoeus.get('https://ajax.googleapis.com/ajax/services/feed/load?num=50&q=http%3A%2F%2Fwww.google.com%2Ftrends%2Fhottrends%2Fatom%2Ffeed%3Fpn%3Dp1&v=1.0') | |
trends = JSON.parse(response.body)['responseData']['feed']['entries'].map { |x| x['title'] } | |
puts trends | |
#=> ["PGA Championship", "Note 5", "Donna Vekic", "Ruby Rose", "Left Handers Day", "PGA Tour", "James Harden", "China explosion", "Ariel Winter", "Jimmy Carter", "Tom Brady", "The Hateful Eight", "Fallout Shelter", "Kristen Stewart", "National Middle Child Day", "China", "Christina Aguilera", "Billy Joel", "Shade balls", "Meteor Shower"] |
This file contains 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
require 'typhoeus' | |
require 'json' | |
response = Typhoeus.get('http://hawttrends.appspot.com/api/terms/') | |
trends = JSON.parse(response.body)['1'] # for US | |
puts trends | |
#=> ["PGA Championship", "Note 5", "Donna Vekic", "Ruby Rose", "Left Handers Day", "PGA Tour", "James Harden", "China explosion", "Ariel Winter", "Jimmy Carter", "Tom Brady", "The Hateful Eight", "Fallout Shelter", "Kristen Stewart", "National Middle Child Day", "China", "Christina Aguilera", "Billy Joel", "Shade balls", "Meteor Shower"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment