Sha256: 3718c5ec1f719c316a946a399aeb0dda3e591c0112658fd990d76094b75f6fe0
Contents?: true
Size: 773 Bytes
Versions: 8
Compression:
Stored size: 773 Bytes
Contents
module Twitter class Trends include HTTParty base_uri 'search.twitter.com/trends' format :json # :exclude => 'hashtags' to exclude hashtags def self.current(options={}) mashup(get('/current.json', :query => options)) end # :exclude => 'hashtags' to exclude hashtags # :date => yyyy-mm-dd for specific date def self.daily(options={}) mashup(get('/daily.json', :query => options)) end # :exclude => 'hashtags' to exclude hashtags # :date => yyyy-mm-dd for specific date def self.weekly(options={}) mashup(get('/weekly.json', :query => options)) end private def self.mashup(response) response['trends'].values.flatten.map { |t| Mhash.new(t) } end end end
Version data entries
8 entries across 8 versions & 3 rubygems