Sha256: 745da42714eac3afc06074221d05a26643b5fc0c0ffc4d0f26ca52f466bd5de2

Contents?: true

Size: 731 Bytes

Versions: 8

Compression:

Stored size: 731 Bytes

Contents

module Twitter
  class LocalTrends
    include HTTParty
    base_uri "api.twitter.com/#{API_VERSION}/trends"
    format :json

    def self.available(query={})
      before_test(query)
      query.delete(:api_endpoint)
      get("/available.json", :query => query).map{|location| Twitter.mash(location)}
    end

    def self.for_location(woeid,options = {})
      before_test(options)
      get("/#{woeid}.json").map{|location| Twitter.mash(location)}
    end

    private
    
    def self.before_test(options)
      configure_base_uri(options)
    end

    def self.configure_base_uri(options)
      new_base_url = options[:api_endpoint]
      base_uri "#{new_base_url}/#{API_VERSION}/trends" if new_base_url
    end

  end
end

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
rorra-twitter-0.9.9 lib/twitter/local_trends.rb
twitter-multi-0.9.8.3 lib/twitter/local_trends.rb
twitter-multi-0.9.8.2 lib/twitter/local_trends.rb
twitter-multi-0.9.8.1 lib/twitter/local_trends.rb
joelind-twitter-0.10.2 lib/twitter/local_trends.rb
joelind-twitter-0.10.1 lib/twitter/local_trends.rb
joelind-twitter-0.9.9 lib/twitter/local_trends.rb
jlind-twitter-0.9.9 lib/twitter/local_trends.rb