use extra variable instead of post['category'] directly

master v0.3
lub 2 years ago
parent b2c23d0446
commit 3b78b19330

@ -152,8 +152,9 @@ async def main():
# scrape all blog posts and process them
blog = get_blog()
for post in blog:
category = post['category']
# check if post url is in cache and matches our category
if post['category'] in category_list and post['url'] not in cache[post['category']]:
if category in category_list and post['url'] not in cache[category]:
# post url not found in cache
# announce new post to matrix rooms
print('new post: '+post['url'])
@ -173,7 +174,7 @@ async def main():
content=content)
# add url to cache
cache[post['category']] += [post['url']]
cache[category] += [post['url']]
else:
# no new posts found

Loading…
Cancel
Save