Permalink
Browse files

Remove get and search functions because nothing works w/o auth now.

  • Loading branch information...
1 parent b57fa15 commit 356c010fc475b14114fc7be66036be54e522f081 @sixohsix committed Jun 22, 2013
Showing with 4 additions and 15 deletions.
  1. +0 −11 twitter/api2.py
  2. +4 −4 twitter/cmdline.py
View
@@ -128,17 +128,6 @@ def post(self, path, **kwargs):
return handle_res(res, self.return_raw_response, self.stream)
-_default_api = TwitterAPI()
-
-get = _default_api.get
-
-
-_search_api = TwitterAPI(domain="search.twitter.com", api_version=None)
-
-def search(q, **kwargs):
- return _search_api.get("search", q=q, **kwargs)
-
-
def make_url(secure, host, api_ver, path, params):
remaining_params = dict(params)
real_params = []
View
@@ -97,7 +97,7 @@
import webbrowser
-from .api2 import TwitterAPI, TwitterError, search
+from .api2 import TwitterAPI, TwitterError
from .oauth import OAuth, write_token_file, read_token_file
from .oauth_dance import oauth_dance
from . import ansi
@@ -278,8 +278,8 @@ def __call__(self, action, user):
class SearchFormatter(object):
def __call__(self, result, options):
return("%s%s %s" % (
- get_time_string(result, options, "%a, %d %b %Y %H:%M:%S +0000"),
- result['from_user'], result['text']))
+ get_time_string(result, options),
+ result['user']['screen_name'], result['text']))
class VerboseSearchFormatter(SearchFormatter):
pass # Default to the regular one
@@ -424,7 +424,7 @@ def __call__(self, twitter, options):
[quote(term)
for term in options['extra_args']])
- results = search(query_string)['results']
+ results = twitter.get('search/tweets', q=query_string)['statuses']
f = get_formatter('search', options)
for result in results:
resultStr = f(result, options)

0 comments on commit 356c010

Please sign in to comment.