PHP - Problema con Rss, php y facebook instant articles

 
Vista:

Problema con Rss, php y facebook instant articles

Publicado por Arsenio (1 intervención) el 04/03/2017 23:15:02
Muy buenas a todos, soy nuevo en el foro asi es que perdonenme si es que me equivoco de tipo de foro, desde ayer que estoy intentando crear un rss que sea compatible con facebook instant articles, despues de leer todos los requisitos de prueba y seguir sus codigos recomendados consegui insertar mis articulos en facebook instant articles. El problema es que tengo cargado 4 articulos en la base de datos y los traigo al rss con php pero en el apartado de articulos en produccion de facebook solo me aparece un articulo. Me estoy volviendo loco. espero que alguno de ustedes pueda ayudarme.

mi codigo es el siguiente:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
require '../functions.php';
require '../config.php';
$conexion=conexion($bd_config);
if (!$conexion) {
  header('Location:'.RUTA.'error.php');
  die();
}
$sentencia=$conexion->prepare('SELECT * FROM noticias WHERE archivado=0 ORDER BY fecha_modificacion DESC');
$sentencia->execute();
$noticias = $sentencia->fetchALL();
 
$sentencia=$conexion->prepare('SELECT * FROM blog ORDER BY fecha_modificacion DESC');
$sentencia->execute();
$blog=$sentencia->fetchALL();
header ("Content-type: text/xml");
echo ("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
 
 
echo '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">

  <channel>
    <title>Noticias MarkeArt</title>
    <link>http://www.markeart.com.py</link>
    <description>
      Noticias de marketing digital en Paraguay
    </description>
    <language>en-us</language>
    <lastBuildDate>2017-03-03T23:39:16Z</lastBuildDate>';
foreach($noticias as $noticia){
 
  echo '<item>
      <title>'.$noticia["titulo"].'</title>
      <link>'.RUTA.'Noticias/'.$noticia["id_noticia"].'/'.$noticia["URL"].'</link>
      <pubDate>'.$noticia["timestap"].'</pubDate>
      <author>'.$noticia["creador"].'</author>
      <description>'.$noticia["extracto"].'</description>
      <content:encoded><![CDATA[';
 
 
echo '<!doctype html>
<html lang="en" prefix="op: http://media.facebook.com/op#">
  <head>
    <meta charset="utf-8">';
    echo '<link rel="canonical" href="'.RUTA.'Noticias/'.$noticia["id_noticia"].'/'.$noticia["URL"].'">
    <meta property="op:markup_version" content="v1.0">';
echo  '</head>
  <body>
    <article>
      <header>
        <!-- The title and subtitle shown in your Instant Article -->
        <h1>'.$noticia["titulo"].'</h1>

        <!-- The date and time when your article was originally published -->
        <time class="op-published" datetime="'.$noticia["fecha_modificacion"].'">'.fecha($noticia["fecha_modificacion"]).'</time>

        <!-- The date and time when your article was last updated -->
        <time class="op-modified" dateTime="'.$noticia["timestap"].'">'.fecha($noticia["timestap"]).'</time>

        <!-- The authors of your article -->
        <address>
          <a rel="facebook" href="http://facebook.com/markeartpy">MarkeArt</a>
        </address>

        <figure>
          <img src="http://www.markeart.com.py/img_web/'.$noticia["thumb"].'" alt="markeartPy">
        </figure>

        <!-- A kicker for your article -->

      </header>

      <!-- Article body goes here -->

      <!-- Body text for your article -->';
    echo  '<p>'.$noticia["texto"].'</p>';
 
 
 
    echo  '<footer>
        <aside>MarkeArt</aside>

        <!-- Copyright details for your article -->
        <small>MarkeArt 2017 © Todos los derechos reservados</small>
      </footer>
    </article>
  </body>
</html>]]>

     </content:encoded>
</item>';
 
}
 
echo '</channel>

</rss>';
?>


Aqui esta el link de mi feed.php ---> https://www.markeart.com.py/feeds/feed.php
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder