diff --git a/lib/twitter/api.rb b/lib/twitter/api.rb index 25747d3e1..0c9f4452c 100644 --- a/lib/twitter/api.rb +++ b/lib/twitter/api.rb @@ -1618,7 +1618,7 @@ def saved_search_destroy(*args) # @example Returns tweets related to twitter # Twitter.search('twitter') def search(q, options={}) - object_from_response(Twitter::SearchResults, :get, "/search.json", options.merge(:q => q), :endpoint => @search_endpoint) + object_from_response(Twitter::SearchResults, :get, "/1.1/search/tweets.json", options.merge(:q => q)) end # Returns recent Tweets related to a query with images and videos embedded diff --git a/lib/twitter/configurable.rb b/lib/twitter/configurable.rb index 8ecdf47c7..a8ac93428 100644 --- a/lib/twitter/configurable.rb +++ b/lib/twitter/configurable.rb @@ -3,7 +3,7 @@ module Twitter module Configurable attr_writer :consumer_key, :consumer_secret, :oauth_token, :oauth_token_secret - attr_accessor :endpoint, :media_endpoint, :search_endpoint, :connection_options, :identity_map, :middleware + attr_accessor :endpoint, :media_endpoint, :connection_options, :identity_map, :middleware class << self @@ -15,7 +15,6 @@ def keys :oauth_token_secret, :endpoint, :media_endpoint, - :search_endpoint, :connection_options, :identity_map, :middleware, diff --git a/lib/twitter/default.rb b/lib/twitter/default.rb index 8da288ed4..516a47167 100644 --- a/lib/twitter/default.rb +++ b/lib/twitter/default.rb @@ -12,7 +12,6 @@ module Twitter module Default ENDPOINT = 'https://api.twitter.com' unless defined? ENDPOINT MEDIA_ENDPOINT = 'https://upload.twitter.com' unless defined? MEDIA_ENDPOINT - SEARCH_ENDPOINT = 'https://search.twitter.com' unless defined? SEARCH_ENDPOINT CONNECTION_OPTIONS = { :headers => { :accept => 'application/json', @@ -85,11 +84,6 @@ def media_endpoint MEDIA_ENDPOINT end - # @return [String] - def search_endpoint - SEARCH_ENDPOINT - end - # @return [Hash] def connection_options CONNECTION_OPTIONS diff --git a/spec/twitter/api/search_spec.rb b/spec/twitter/api/search_spec.rb index 8b334ec42..0960115ec 100644 --- a/spec/twitter/api/search_spec.rb +++ b/spec/twitter/api/search_spec.rb @@ -8,13 +8,13 @@ describe "#search" do before do - stub_get("/search.json", "https://search.twitter.com"). + stub_get("/1.1/search/tweets.json"). with(:query => {:q => "twitter"}). to_return(:body => fixture("search.json"), :headers => {:content_type => "application/json; charset=utf-8"}) end it "requests the correct resource" do @client.search('twitter') - a_get("/search.json", "https://search.twitter.com"). + a_get("/1.1/search/tweets.json"). with(:query => {:q => "twitter"}). should have_been_made end @@ -32,7 +32,7 @@ context "when search API responds a malformed result" do before do - stub_get("/search.json", "https://search.twitter.com"). + stub_get("/1.1/search/tweets.json"). with(:query => {:q => "twitter"}). to_return(:body => fixture("/search_malformed.json"), :headers => {:content_type => "application/json; charset=utf-8"}) end diff --git a/spec/twitter/client_spec.rb b/spec/twitter/client_spec.rb index d008a43fa..5360e0ca4 100644 --- a/spec/twitter/client_spec.rb +++ b/spec/twitter/client_spec.rb @@ -41,7 +41,6 @@ :middleware => Proc.new{}, :oauth_token => 'OT', :oauth_token_secret => 'OS', - :search_endpoint => 'http://search.twitter.com', :identity_map => ::Hash } end