djthyrax Posted May 14, 2008 at 10:54 PM Report Share #185201 Posted May 14, 2008 at 10:54 PM Old code para ver novos posts no P@P através do feed RSS. <?php //header("Content-Type: text/plain"); header("Content-Type: text/html; charset=utf-8"); include "lib/rss_php.php"; $x = new rss_php; $x->load("http://www.portugal-a-programar.org/forum/index.php?type=rss;action=.xml;limit=10"); $y = $x->getRSS(true); //var_dump($y['rss']['value']['channel']['value']); 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> </tr>"; $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>%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/ Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now