reverse order in which scraped posts are returned

master
lub 5 years ago
parent 35edcac481
commit 5b37157a49

@ -62,6 +62,10 @@ def get_blog():
'url': base_url+article_html.find(class_='ArticleLink').attrs['href'], '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 return blog
def get_body(post): def get_body(post):
body = post['title']+"\n" body = post['title']+"\n"

Loading…
Cancel
Save