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 = []
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
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
[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)