]> jfr.im git - z_archive/twitter.git/commitdiff
Remove get and search functions because nothing works w/o auth now. next_gen
authorMike Verdone <redacted>
Sat, 22 Jun 2013 17:53:30 +0000 (11:53 -0600)
committerMike Verdone <redacted>
Sat, 22 Jun 2013 17:53:30 +0000 (11:53 -0600)
twitter/api2.py
twitter/cmdline.py

index 91f1744c3036bedbf04aaacb4a9b0efb082d17ed..811a25bca0fb34595cdf4efbd568dae442840998 100644 (file)
@@ -128,17 +128,6 @@ class TwitterAPI(object):
         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 = []
index b2d1765e250254b9fa30d3a6bf4d125995a1e839..6cc138640688f8370df2452bdd2093646afe9db7 100644 (file)
@@ -97,7 +97,7 @@ except ImportError:
 
 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 @@ class VerboseAdminFormatter(object):
 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 @@ class SearchAction(Action):
             [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)