From ee49d2021e46c556d2aa3646cdb5d40105714ff5 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 5 Nov 2020 20:28:55 +0000 Subject: [PATCH] newsroom --- apiserver/feeds/news.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apiserver/feeds/news.py b/apiserver/feeds/news.py index 23e147a..ae860b8 100644 --- a/apiserver/feeds/news.py +++ b/apiserver/feeds/news.py @@ -17,7 +17,7 @@ import pytz from utils import clean USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0' - +#USER_AGENT = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" def unix(date_str, tz=None): date_tzfix = date_str @@ -223,4 +223,9 @@ if __name__ == '__main__': print(posts[:1]) print(site.story(posts[0])) - + print("Sitemap: Newsroom") + site = Sitemap("https://www.newsroom.co.nz/sitemap.xml") + posts = site.feed() + print(posts[:5]) + print(site.story(posts[0])) +