Module: Twitter::Client::LocalTrends
- Included in:
- Twitter::Client
- Defined in:
- lib/twitter/client/local_trends.rb
Overview
Defines methods related to local trends
Instance Method Summary collapse
-
#local_trends(woeid = 1, options = {}) ⇒ Array<Twitter::Trend>
Returns the top 10 trending topics for a specific WOEID.
-
#trend_locations(options = {}) ⇒ Array<Twitter::Place>
Returns the locations that Twitter has trending topic information for.
Instance Method Details
#local_trends(woeid = 1, options = {}) ⇒ Array<Twitter::Trend>
Returns the top 10 trending topics for a specific WOEID
21 22 23 24 25 |
# File 'lib/twitter/client/local_trends.rb', line 21 def local_trends(woeid=1, ={}) get("/1/trends/#{woeid}.json", ).first['trends'].map do |trend| Twitter::Trend.new(trend) end end |
#trend_locations(options = {}) ⇒ Array<Twitter::Place>
Returns the locations that Twitter has trending topic information for
38 39 40 41 42 |
# File 'lib/twitter/client/local_trends.rb', line 38 def trend_locations(={}) get("/1/trends/available.json", ).map do |place| Twitter::Place.new(place) end end |