From 5b37157a49a61303a3286531ad5d730b9cdeb633 Mon Sep 17 00:00:00 2001 From: lub Date: Mon, 4 May 2020 20:12:26 +0200 Subject: [PATCH] reverse order in which scraped posts are returned --- scrape.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scrape.py b/scrape.py index ce01c89..50c91a7 100644 --- a/scrape.py +++ b/scrape.py @@ -62,6 +62,10 @@ def get_blog(): 'url': base_url+article_html.find(class_='ArticleLink').attrs['href'], }) + # reverse order so the oldest article is at [0] + # we want to iterate later from oldest to newest + blog.reverse() + return blog def get_body(post): body = post['title']+"\n"