From 2befe91efdf9c17e9da86e06d35b4d9341fd225a Mon Sep 17 00:00:00 2001 From: Francisco Pessano Date: Fri, 16 Jul 2021 22:33:39 -0300 Subject: [PATCH] =?UTF-8?q?A=C3=B1adido=20soporte=20para=20TN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control-files/00_ids_done.txt | 2 +- control-files/00_news_done.txt | 2 +- news.css | 2 +- news_logic.php | 15 ++++++++++ scripts/tn.js | 53 ++++++++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 scripts/tn.js diff --git a/control-files/00_ids_done.txt b/control-files/00_ids_done.txt index 301160a..f11c82a 100755 --- a/control-files/00_ids_done.txt +++ b/control-files/00_ids_done.txt @@ -1 +1 @@ -8 \ No newline at end of file +9 \ No newline at end of file diff --git a/control-files/00_news_done.txt b/control-files/00_news_done.txt index 084c758..b64d3cc 100755 --- a/control-files/00_news_done.txt +++ b/control-files/00_news_done.txt @@ -1 +1 @@ - ./news/1.html ./news/2.html ./news/3.html ./news/4.html ./news/5.html ./news/6.html ./news/7.html ./news/8.html \ No newline at end of file + ./news/1.html ./news/2.html ./news/3.html ./news/4.html ./news/5.html ./news/6.html ./news/7.html ./news/8.html ./news/9.html \ No newline at end of file diff --git a/news.css b/news.css index bfdb090..047e8a8 100755 --- a/news.css +++ b/news.css @@ -65,7 +65,7 @@ img { article img { width: 100%; - height: 100%; + height: auto; margin-bottom: 2vh; } diff --git a/news_logic.php b/news_logic.php index 614d073..84f994b 100755 --- a/news_logic.php +++ b/news_logic.php @@ -32,6 +32,10 @@ function know_page($news_unique) { case $news_unique === './news/infobae.html' || $news_unique === './news/Infobae.html': return 'Infobae'; break; + + case $news_unique === './news/tn.html' || $news_unique === './news/TN.html' || $news_unique === './news/Tn.html': + return 'TN'; + break; default: return 0; @@ -59,6 +63,10 @@ function know_author($page, $news_unique) { return $author = get_string_between($content, ',t.authors="', '",'); break; + case $page === 'TN': + return $author = 0; + break; + default: return 0; break; @@ -106,11 +114,18 @@ function create_entry_in_DB($news_unique, $page, $author) { $frist_p = get_string_between($content, ''); break; + case $page === 'TN': + $title = get_string_between($content, '', ' | TN'); + $icon = get_string_between($content, '', '') . ''; + $frist_p = get_string_between($content, ',"description":"', '","articleBody":"'); + break; default: echo 0; return 0; break; } + $title; $icon; $inner_HTML; diff --git a/scripts/tn.js b/scripts/tn.js new file mode 100644 index 0000000..cbfa692 --- /dev/null +++ b/scripts/tn.js @@ -0,0 +1,53 @@ +//todo - Informacion sobre tn + +title = document.getElementsByClassName('article__title bold')[0] +console.log(title); + +sub_title = document.getElementsByClassName('article__dropline soft')[0] +console.log(sub_title) + +article = document.getElementsByClassName('article__body')[0] + +trash = [ + document.getElementsByClassName('flex justify_space_between align_items_center padding_bottom-sm')[0], + + document.getElementsByClassName('time__container')[0] +] +console.log(trash); + +ads = document.getElementsByClassName('interstitial--link') +console.log(ads) + + +//todo - Purificacion de la informacion + +for (let i = 0; i < trash.length; i++) { + trash[i].innerHTML = '' +} + +for (let i = 0; i < ads.length; i++) { + ads[i].innerHTML = ''; + +} + +//todo - AƱadir sub-titulo al articulo y eliminar el original + +newParagraph = document.createElement('p') + +newParagraph.innerText = sub_title.innerText + +article.prepend(newParagraph) + +sub_title.remove() + +console.log(newParagraph); + +//todo - Eliminar el titulo + +title.remove() + +//todo - Eliminar el script + +script = document.getElementById('script-estructurator'); + +script.remove() \ No newline at end of file