Created
October 15, 2012 05:41
-
-
Save shunirr/3890971 to your computer and use it in GitHub Desktop.
Twitter4R が古いエンドポイント向いてる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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