Fix-update Faz.net (error in json)

This commit is contained in:
magnolia1234 2020-11-24 19:12:07 +01:00
parent a4b3524cfb
commit 586725cd23
2 changed files with 5 additions and 1 deletions

View file

@ -5,6 +5,7 @@ Post-release
Add El Periodico (Spain) Add El Periodico (Spain)
Add Grupo Vocento (Spain, regional daily) Add Grupo Vocento (Spain, regional daily)
Fix-update Corriere Della Sera (redirect preview) Fix-update Corriere Della Sera (redirect preview)
Fix-update Faz.net (error in json)
Fix popup (update notification & close error) Fix popup (update notification & close error)
Update block general paywall script (Pelcro) Update block general paywall script (Pelcro)
Update grouped sites (init rules) Update grouped sites (init rules)

View file

@ -810,7 +810,10 @@ else if (matchDomain('faz.net')) {
var doc = parser.parseFromString(html, 'text/html'); var doc = parser.parseFromString(html, 'text/html');
let json = doc.querySelector('script[id="schemaOrgJson"]'); let json = doc.querySelector('script[id="schemaOrgJson"]');
if (json) { if (json) {
var json_text = JSON.parse(json.text).ArticleBody; let split1 = json.text.split('"ArticleBody": "');
let split2 = split1[1].split('","author":');
var json_text_clean = split1[0] + '"ArticleBody": "' + split2[0].replace(/"/g, '“') + '","author":' + split2[1];
var json_text = JSON.parse(json_text_clean).ArticleBody;
let article_text = document.querySelector('.art_txt.paywall,.atc-Text.js-atc-Text'); let article_text = document.querySelector('.art_txt.paywall,.atc-Text.js-atc-Text');
article_text.innerText = ''; article_text.innerText = '';