From dfaece92a5a8419189e573bb5e7b40416d76a438 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 24 May 2024 15:29:42 +0200 Subject: [PATCH] add return link --- lemonde.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lemonde.js b/lemonde.js index df372ca..952c860 100644 --- a/lemonde.js +++ b/lemonde.js @@ -1,7 +1,7 @@ -// open https://journal.lemonde.fr, hit f12 and find GetPublicationContentItems complete url +// open https://journal.lemonde.fr, open an issue, hit f12 and find the GetPublicationContentItems url -var url = "https://lmo-lmo-production-cdn.twipecloud.net/lmo/lmo/contentPackages/3761/GetPublicationContentItems-5274.json?v=20240524113722&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHBzOi8vbG1vLWxtby1wcm9kdWN0aW9uLWNkbi50d2lwZWNsb3VkLm5ldC9sbW8vbG1vL2NvbnRlbnRQYWNrYWdlcy8zNzYxLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3MTY1NTYxOTF9LCJJcEFkZHJlc3MiOnsiQVdTOlNvdXJjZUlwIjoiMC4wLjAuMC8wIn0sIkRhdGVHcmVhdGVyVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNzE2NTU0MzMxfX19XX0_&Signature=qXAEoL6W8UYp1zrq7x1hMPyxTW1NQnyrTB9AJzSRtAUjhpNgd3TQ5kZ4Ma9qndRpEmX4emYp16sEx4TMI1Jq-Bhv~-y47QUUMj7codXTxdMhLd3-tVLb6oftQOA2cmpjjx1VY3fO2gc8DHTQSvFGsCpnOBMHZDCODjS2xCOPnps_&Key-Pair-Id=APKAJZKKWCWU2JPGEHQQ"; -var output = ""; +var url = "https://lmo-lmo-production-cdn.twipecloud.net/lmo/lmo/contentPackages/3761/GetPublicationContentItems-5274.json?v=20240524113722&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHBzOi8vbG1vLWxtby1wcm9kdWN0aW9uLWNkbi50d2lwZWNsb3VkLm5ldC9sbW8vbG1vL2NvbnRlbnRQYWNrYWdlcy8zNzYxLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3MTY1NTg4MzF9LCJJcEFkZHJlc3MiOnsiQVdTOlNvdXJjZUlwIjoiMC4wLjAuMC8wIn0sIkRhdGVHcmVhdGVyVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNzE2NTU2OTcxfX19XX0_&Signature=gfKT8bLNWoohcNqbvA7A~UKZMSLIJxLuPo5sJFtG1lmXwWfTl~3Y4RmgDn00uZ4VIW6uRJJFEIldrL9iBbUMY7LgtiDOpBxj5zPv-UBqN8mkxUkdd7OBPtAypz~7lByyx92or6VzOUzkMYEZ-ptPHVWyUon4Jv1BudMTxmWa1Vg_&Key-Pair-Id=APKAJZKKWCWU2JPGEHQQ"; +var output = "

Le Monde 25 mai 2024

"; var toc = ""; function sanitize(s) @@ -28,8 +28,16 @@ fetch(url) var id = article.ContentID; var page = article.PageNumber; + output += "

" + title + "

"; + if (category) + { + output += "

" + category + "

"; + } + output += contentitem.HtmlText; + if (page > 1) { + output += "

Retour

"; toc += "" + title + "" if (category) { @@ -37,13 +45,6 @@ fetch(url) } toc += "
"; } - - output += "

" + title + "

"; - if (category) - { - output += "

" + category + "

"; - } - output += contentitem.HtmlText; } }); console.log("Le Monde" + toc + output + "");