Commit 8f9c662e authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Added trends api endpoint to api.

parent 2ac4e73d
......@@ -374,3 +374,10 @@ class API(object):
allowed_param = ['q', 'lang', 'rpp', 'page', 'since_id', 'geocode', 'show_user'],
)(self, *args, **kargs)
def trends(self):
return bind_api(
host = 'search.' + self.host,
path = '/trends.json',
parser = parse_trend_results
)(self)
......@@ -9,6 +9,18 @@ try:
except ImportError:
import simplejson as json
def parse_json(data, api):
return json.loads(data)
def parse_return_true(data, api):
return True
def parse_none(data, api):
return None
def parse_error(data):
return json.loads(data)['error']
......@@ -161,14 +173,8 @@ def parse_search_results(data, api):
result_objects.append(_parse_search_result(obj, api))
return result_objects
def parse_json(data, api):
return json.loads(data)
def parse_return_true(data, api):
def parse_trend_results(data, api):
return True
return json.loads(data)['trends']
def parse_none(data, api):
return None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment