From 3daae5fa1bbcb9ceb4e36afda7cf60fa756dcf91 Mon Sep 17 00:00:00 2001 From: Jason Schwarzenberger Date: Mon, 23 Nov 2020 16:46:54 +1300 Subject: [PATCH] change substack time parsing to misc.time --- apiserver/feeds/substack.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apiserver/feeds/substack.py b/apiserver/feeds/substack.py index b52fd50..e3efe87 100644 --- a/apiserver/feeds/substack.py +++ b/apiserver/feeds/substack.py @@ -10,6 +10,7 @@ if __name__ == '__main__': import requests from datetime import datetime +from misc.time import unix from utils import clean SUBSTACK_REFERER = 'https://substack.com' @@ -22,9 +23,6 @@ def api_comments(post_id, base_url): def api_stories(x, base_url): return f"{base_url}/api/v1/archive?sort=new&search=&offset=0&limit=100" -def unix(date_str): - return int(datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S.%fZ').timestamp()) - def api(route, ref=None, referer=None): headers = {'Referer': referer} if referer else None try: