Skip to content

Instantly share code, notes, and snippets.

@shunirr
Created October 15, 2012 05:41
Show Gist options
  • Select an option

  • Save shunirr/3890971 to your computer and use it in GitHub Desktop.

Select an option

Save shunirr/3890971 to your computer and use it in GitHub Desktop.
Twitter4R が古いエンドポイント向いてる
class Twitter::Client
def rest_request_uri(path, params = nil)
uri = "#{self.class.config.path_prefix}/1#{path}"
uri << "?#{params.to_http_str}" if params
p uri
uri
end
def uri_components(service = :rest)
case service
when :rest
return self.class.config.protocol, "api.twitter.com", self.class.config.port,
self.class.config.path_prefix
when :search
return self.class.config.search_protocol, "api.twitter.com",
self.class.config.search_port, self.class.config.search_path_prefix
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment