Skip to content

Commit

Permalink
Remove get and search functions because nothing works w/o auth now.
Browse files Browse the repository at this point in the history
  • Loading branch information
sixohsix committed Jun 22, 2013
1 parent b57fa15 commit 356c010
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
11 changes: 0 additions & 11 deletions twitter/api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
8 changes: 4 additions & 4 deletions twitter/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 356c010

Please sign in to comment.