• Revista PROGRAMAR: Já está disponível a edição #53 da revista programar. Faz já o download aqui!

Sign in to follow this  
Followers 0

[PHP]Novos posts no P@P

1 post in this topic

Old code para ver novos posts no P@P através do feed RSS.

//header("Content-Type: text/plain");
header("Content-Type: text/html; charset=utf-8");	
include "lib/rss_php.php";

$x = new rss_php;
$y = $x->getRSS(true);

echo "<table border='1'>";
echo "          <tr>
              <td align='center'>Nome do Post (Quadro)</td>
              <td align='center'>Descrição</td>
              <td align='center'>Data</td>

$items = $y['rss']['value']['channel']['value'];
foreach($items as $k => $item){
if(substr($k, 0, 4) != "item") continue;
$item = $item["value"];
printf("          <tr>
              <td align='center'><a href='%s'>%s</a> (%s)</td>
              <td align='center'>%s</td>
          </tr>", $item['guid']['value'] , $item['title']['value'], $item['category']['value'], $item['description']['value'], $item['pubDate']['value']);

echo "</table>";

A class rss_php é esta: http://rssphp.net/


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0