From db258dad2ff1f4341c3dd0fa0ac05bfbded58f81 Mon Sep 17 00:00:00 2001 From: robhawkins Date: Wed, 25 Jul 2018 17:50:15 +0800 Subject: [PATCH] fix for paging --- psaw/PushshiftAPI.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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):