') . '';
$frist_p = strip_tags(get_string_between($inner_HTML, '
', '
'));
break;
+
+ case $page === 'Infobae':
+ $title = get_string_between($content, '
', '- Infobae');
+ $pre_icon = get_string_between($content, '
', '
');
+ $icon = get_string_between($pre_icon, '992w,', ' 1200w" ');
+ $inner_HTML = get_string_between($content, '
') . '';
+ $frist_p = get_string_between($content, '
');
+ break;
default:
echo 0;
return 0;
break;
}
+ $title;
+ $icon;
+ $inner_HTML;
+ $frist_p;
$insert_news = $mySQLconnect -> prepare('insert into noticias (title, content, icon_route, page_source, author, frist_paragraph) values (?, ?, ?, ?, ?, ?)');
@@ -119,7 +141,7 @@ function bring_the_news_back_home($actual_page, $news_per_page) {
$frist_calc = $actual_page * $news_per_page;
$second_calc = ($actual_page * $news_per_page) - $news_per_page;
- $prepared_query = $mySQLconnect -> prepare("select id, title, frist_paragraph, icon_route from noticias where id < ? and id > ?");
+ $prepared_query = $mySQLconnect -> prepare("select id, title, frist_paragraph, icon_route, page_source from noticias where id < ? and id > ?");
$prepared_query -> bindParam(1, $frist_calc, PDO::PARAM_INT);
$prepared_query -> bindParam(2, $second_calc, PDO::PARAM_INT);
//$prepared_query -> execute(array($actual_page * 10, $actual_page * 10 - 10));
diff --git a/scripts/genbeta.js b/scripts/genbeta.js
old mode 100644
new mode 100755
diff --git a/scripts/infobae.js b/scripts/infobae.js
new file mode 100755
index 0000000..24c5c3c
--- /dev/null
+++ b/scripts/infobae.js
@@ -0,0 +1,87 @@
+//todo - Informacion de infobae
+
+title = document.getElementsByClassName('article-headline')[0];
+console.log(title);
+
+sub_title = document.getElementsByClassName('article-subheadline')[0];
+console.log(sub_title);
+
+content = document.getElementsByClassName('nd-body-article')[0];
+console.log(content);
+
+trash = [document.getElementsByClassName('infogram-embed')[0]];
+console.log(trash);
+
+paragraphs = document.querySelectorAll('.paragraph, .visual__image');
+console.log(paragraphs);
+
+infobae = document.getElementsByTagName('article')[0];
+
+
+//todo - Estructura del sitio web cliente
+
+all = document.getElementsByClassName('all')[0];
+console.log(all);
+
+//todo - Purificacion de la informacion
+
+for (let i = 0; i < paragraphs.length; i++) {
+ if (paragraphs[i].innerHTML == "
SEGUIR LEYENDO:" || paragraphs[i].innerHTML == "
SEGUIR LEYENDO" || paragraphs[i].innerHTML == "
") {
+ console.log("AAAAA");
+ trash.push(paragraphs[i])
+
+ }
+
+}
+
+title.innerHTML = ''
+
+for (let i = 0; i < trash.length; i++) {
+ if (trash[i] !== undefined){
+ trash[i].innerHTML = ''
+ trash[i].remove();
+ }
+}
+
+//todo - Copiar e insertar informacion en el sitio web cliente
+
+//! TITULO
+all.appendChild(title);
+
+frist_p = document.createElement("P")
+frist_p.innerText = sub_title.innerText
+
+//! PARRAFOS
+paragraphsFragment = document.createDocumentFragment();
+
+paragraphsFragment.appendChild(frist_p)
+
+for (let i = 0; i < paragraphs.length; i++) {
+
+ if (paragraphs[i].className == "visual__image ") {
+ console.log("AAAA");
+
+ paragraphs[i].children[0].style.height = "auto"
+ paragraphs[i].children[0].style.width = "100%"
+ }
+
+ console.log(paragraphs[i]);
+ paragraphsFragment.appendChild(paragraphs[i])
+
+}
+
+article = document.createElement('article')
+
+article.appendChild(paragraphsFragment)
+
+all.appendChild(article)
+
+//todo - Eliminar informacion de infobae
+
+infobae.remove()
+
+//todo - Eliminar el script
+
+script = document.getElementById('script-estructurator');
+
+script.remove()
\ No newline at end of file
diff --git a/style.css b/style.css
index 2d4f9d9..db64d8f 100755
--- a/style.css
+++ b/style.css
@@ -80,6 +80,8 @@ header {
margin-right: 2vw;
width: calc(74vw - 150px - 6vw);
margin-bottom: 2vh;
+ display: flex;
+ flex-direction: column;
}
.card h2 {
@@ -113,3 +115,7 @@ header {
color: #797979;
}
+.card .source {
+ align-self: flex-end;
+ flex-grow: 1;
+}
\ No newline at end of file
diff --git a/test-page.php b/test-page.php
new file mode 100755
index 0000000..9ad5a75
--- /dev/null
+++ b/test-page.php
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+ Autor: | Pagina fuente:
+
+
+
+
\ No newline at end of file