From 1424049f30e8726ba35304c5268d75ae514aa29d Mon Sep 17 00:00:00 2001 From: Alexei Bezborodov Date: Wed, 24 Jan 2024 20:05:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=B8=D1=81?= =?UTF-8?q?=D1=82=D0=BE=D1=87=D0=BD=D0=B8=D0=BA:=20=D0=93=D0=B0=D0=B7?= =?UTF-8?q?=D0=B5=D1=82=D0=B0=20=D0=98=D0=B7=D0=B2=D0=B5=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- news_parser.js | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/news_parser.js b/news_parser.js index 1176219..dc63769 100644 --- a/news_parser.js +++ b/news_parser.js @@ -1,7 +1,7 @@ // ==UserScript== // @name News parser // @namespace http://zakonvremeni.ru -// @version 0.3.4 +// @version 0.3.5 // @description Parse news // @author AlexeiBv+mirocod@narod.ru // @match https://tass.ru/* @@ -10,6 +10,7 @@ // @match https://www.cnews.ru/* // @match https://mixednews.ru/* // @match https://russian.rt.com/* +// @match https://iz.ru/* // @match https://zakonvremeni.ru/* // @icon https://icons.duckduckgo.com/ip2/zakonvremeni.ru.ico // @grant none @@ -459,6 +460,24 @@ [] ); } + else if (location.hostname == 'iz.ru') { + // https://iz.ru/1639291/2024-01-24/amerikanskii-esminetc-uss-john-finn-proshel-cherez-taivanskii-proliv + const base_element = document.getElementById('block-purple-content'); + + content = MakeContentByNews( + base_element, + base_element, + base_element, + 'm-t-10', + 'big_photo__img', + 'text-article__inside', + ElementCheckerTrue, + SubElementCheckerToRemoveTemplate( + 'more_style_one|igi-player|share_bottom|recommendation-block|layer-' //, 'DIV|IFRAME' + ), + [] + ); + } else if (location.hostname == 'zakonvremeni.ru') { const base_element = document.getElementsByClassName('item-page')[0]; const title = GetContentInContainers(FindElementsByRegExp(GetElementClassName, 'page-header', base_element), grub_text_func, FinishWorkFuncZV); @@ -481,9 +500,18 @@ } let content = MakeContent(); - let logo = document.createElement("div"); - logo.innerHTML = '
' + content + '
'; - - document.body.insertBefore(logo, document.body.firstChild); + let news_text = document.createElement("div"); + news_text.innerHTML = '
' + content + '
'; + + if (location.hostname == 'iz.ru') { + let top_panel = document.getElementsByClassName('top-panel')[0]; + top_panel.parentNode.removeChild(top_panel); + let base_child = document.getElementsByClassName('m-t-10')[0]; + base_child.appendChild(news_text); + } + else { + let base_child = document.body.firstChild + document.body.insertBefore(news_text, base_child); + } })();