Sha256: fcd0b5c63b34496f1ad72fda7efd2c927e70ebd4b1602fd6a114222cd41a64ab

Contents?: true

Size: 681 Bytes

Versions: 1

Compression:

Stored size: 681 Bytes

Contents

class Twitter::Client
  @@TRENDS_URIS = {
    :locations => '/trends/available.json',
    :global => '/trends.json',
    :current => '/trends/current.json',
    :daily => '/trends/daily.json',
    :weekly => '/trends/weekly.json',
    :local => '/trends/',
  }

  # Provides access to the Twitter list trends API.
  # 
  # By default you will receive top ten topics that are trending on Twitter.
  def trends(type = :global)
    uri = @@TRENDS_URIS[type]
    response = rest_oauth_connect(:get, uri)
    if type === :locations
      bless_models(Twitter::Location.unmarshal(response.body))
    else
      bless_models(Twitter::Trendline.unmarshal(response.body))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twitter4r-0.7.0 lib/twitter/client/trends.rb