change default value from 100 to null, i.e. don't send a 'limit' parameter
This commit is contained in:
@@ -4605,6 +4605,22 @@ Description
|
|||||||
Ignore all submissions posted before/after the submission with this ID.
|
Ignore all submissions posted before/after the submission with this ID.
|
||||||
|
|
||||||
|
|
||||||
|
extractor.reddit.limit
|
||||||
|
----------------------
|
||||||
|
Type
|
||||||
|
``integer``
|
||||||
|
Default
|
||||||
|
``null``
|
||||||
|
Description
|
||||||
|
Number of results to return in a single API query.
|
||||||
|
|
||||||
|
This value specifies the ``limit`` parameter
|
||||||
|
used for API requests when retrieving paginated results.
|
||||||
|
|
||||||
|
``null`` means not including this parameter at all
|
||||||
|
and letting Reddit chose a default.
|
||||||
|
|
||||||
|
|
||||||
extractor.reddit.previews
|
extractor.reddit.previews
|
||||||
-------------------------
|
-------------------------
|
||||||
Type
|
Type
|
||||||
|
|||||||
@@ -632,6 +632,7 @@
|
|||||||
"date-format" : "%Y-%m-%dT%H:%M:%S",
|
"date-format" : "%Y-%m-%dT%H:%M:%S",
|
||||||
"id-min" : null,
|
"id-min" : null,
|
||||||
"id-max" : null,
|
"id-max" : null,
|
||||||
|
"limit" : null,
|
||||||
"previews" : true,
|
"previews" : true,
|
||||||
"recursion" : 0,
|
"recursion" : 0,
|
||||||
"selftext" : null,
|
"selftext" : null,
|
||||||
|
|||||||
@@ -426,13 +426,11 @@ class RedditAPI():
|
|||||||
def submissions_subreddit(self, subreddit, params):
|
def submissions_subreddit(self, subreddit, params):
|
||||||
"""Collect all (submission, comments)-tuples of a subreddit"""
|
"""Collect all (submission, comments)-tuples of a subreddit"""
|
||||||
endpoint = subreddit + "/.json"
|
endpoint = subreddit + "/.json"
|
||||||
params["limit"] = 100
|
|
||||||
return self._pagination(endpoint, params)
|
return self._pagination(endpoint, params)
|
||||||
|
|
||||||
def submissions_user(self, user, params):
|
def submissions_user(self, user, params):
|
||||||
"""Collect all (submission, comments)-tuples posted by a user"""
|
"""Collect all (submission, comments)-tuples posted by a user"""
|
||||||
endpoint = "/user/" + user + "/.json"
|
endpoint = "/user/" + user + "/.json"
|
||||||
params["limit"] = 100
|
|
||||||
return self._pagination(endpoint, params)
|
return self._pagination(endpoint, params)
|
||||||
|
|
||||||
def morechildren(self, link_id, children):
|
def morechildren(self, link_id, children):
|
||||||
@@ -532,6 +530,9 @@ class RedditAPI():
|
|||||||
id_max = float("inf")
|
id_max = float("inf")
|
||||||
date_min, date_max = self.extractor._get_date_min_max(0, 253402210800)
|
date_min, date_max = self.extractor._get_date_min_max(0, 253402210800)
|
||||||
|
|
||||||
|
if limit := self.extractor.config("limit"):
|
||||||
|
params["limit"] = limit
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
data = self._call(endpoint, params)["data"]
|
data = self._call(endpoint, params)["data"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user