Reverse articles before processing
This commit is contained in:
parent
73aae6ef14
commit
089af0de59
1 changed files with 5 additions and 1 deletions
|
@ -8,7 +8,11 @@ mastodon = Mastodon(access_token = 'kuow_bot_mastodon.secret')
|
|||
|
||||
r = requests.get(url)
|
||||
soup = BeautifulSoup(r.content, 'html.parser')
|
||||
for article in soup.find_all("span", class_ = "txt"):
|
||||
articles = soup.find_all("span", class_ = "txt")
|
||||
# Reverse articles, so that if multiple new ones have been found, they'll be posted in order of when published
|
||||
articles.reverse()
|
||||
|
||||
for article in articles:
|
||||
article_link = article.find("a").attrs["href"]
|
||||
|
||||
is_new_article = True
|
||||
|
|
Loading…
Reference in a new issue