Abstracted out dataset from search api. Should probably rename the PushshiftAPI class as RedditApi or somesuch.

This commit is contained in:
David Marx
2018-08-06 02:00:55 -07:00
parent 891af80a31
commit 529769ef67
+2 -1
View File
@@ -177,9 +177,10 @@ class PushshiftAPIMinimal(object):
kind,
stop_condition=lambda x: False,
return_batch=False,
dataset='reddit',
**kwargs):
self.payload = copy.deepcopy(kwargs)
endpoint = 'reddit/{}/search'.format(kind)
endpoint = '{dataset}/{kind}/search'.format(dataset=dataset, kind=kind)
url = self.base_url.format(endpoint=endpoint)
for response in self._handle_paging(url):
if 'aggs' in response: