javascript: (function() { var map = { "www.mediapart.fr": "https://www.mediapart.fr/articles/feed", "www.lemonde.fr": "https://www.lemonde.fr/rss/une.xml", "www.nytimes.com": "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml", "reporterre.net": "https://reporterre.net/spip.php?page=backend-simple", "lesjours.fr": "https://lesjours.fr/rss.xml" }; var host = window.location.host; var rssurl = map[window.location.host]; if (!rssurl) { alert("unknown newspaper"); } else { fetch(rssurl) .then(response => response.text()) .then(xmlstring => { const parser = new DOMParser(); const xmldoc = parser.parseFromString(xmlstring, 'text/xml'); var today = new Date; items = xmldoc.evaluate("/rss/channel/item", xmldoc); while ((item = items.iterateNext())) { var datenode = item.getElementsByTagName("pubDate"); if (!datenode || !datenode.length) { datenode = item.getElementsByTagName("dc:date"); } var itemdate = new Date(datenode[0].textContent); var itemlink = item.getElementsByTagName("link")[0].textContent; if (itemdate.toDateString() == today.toDateString()) { console.log("will open " + itemlink); window.open(itemlink, "_blank"); } } }); } })();