diff --git a/psaw/PushshiftAPI.py b/psaw/PushshiftAPI.py index 96d55ef..1e26b80 100644 --- a/psaw/PushshiftAPI.py +++ b/psaw/PushshiftAPI.py @@ -203,7 +203,10 @@ class PushshiftAPIMinimal(object): yield batch # For paging. - self.payload['before'] = thing.created_utc + if self.payload.get('sort') == 'desc': + self.payload['before'] = thing.created_utc + else: + self.payload['after'] = thing.created_utc #class PushshiftAPI(PushshiftAPIMinimal):