<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
<title>RSS Commenti Articolo: [PHP] Document Object Model e leggere un RSS non e mai stato tanto facile - davidonzo's blog :)</title>
<link>http://www.davidonzo.com/</link>
<description>RSS Commenti Articolo: [PHP] Document Object Model e leggere un RSS non e mai stato tanto facile - davidonzo's blog :)</description>
<language>IT-it</language>
<generator>davidonzo coding</generator>
<pubDate>Mon, 21 May 2012 22:39:35 +0100</pubDate>
<ttl>60</ttl>
<item>
<title>davidonzo: [PHP] Document Object Model e leggere un RSS non è mai stato tanto facile</title>
<link>http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28804</link>
<description><![CDATA[<pre>for($a = 0; $a &lt;= 4; $a++){<br />  //istruzioni qui<br />}</pre>]]></description>
<pubDate>Sun, 22 Feb 2009 20:32:25 +0100</pubDate>
<guid isPermaLink="false">http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28804</guid>
</item>
<item>
<title>Chri: [PHP] Document Object Model e leggere un RSS non è mai stato tanto facile</title>
<link>http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28802</link>
<description><![CDATA[Mi intrometto :) Non sono praticissimo di php ma trovo molto utile questo script, e avrei una domanda: se volessi mostrare solo gli ultimi 5 post del feed?]]></description>
<pubDate>Sat, 21 Feb 2009 15:57:37 +0100</pubDate>
<guid isPermaLink="false">http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28802</guid>
</item>
<item>
<title>davidonzo: [PHP] Document Object Model e leggere un RSS non è mai stato tanto facile</title>
<link>http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28664</link>
<description><![CDATA[Quello di Gianni &egrave; un feed atom, non RSS :)<br />Usa questo:<br /><br /><pre>&lt;?php<br />$url=&quot;http://feeds.feedburner.com/gianniamato&quot;;<br />  $doc = new DOMDocument;<br />   if(!is_file(&#039;rss.xml&#039;) OR (is_file(&#039;rss.xml&#039;) &amp;&amp; (time() &gt; filemtime(&#039;rss.xml&#039;)+28800))){<br />    $doc-&gt;formatOutput = true;<br />    $doc-&gt;load($url);<br />    $doc-&gt;save(&#039;rss.xml&#039;);<br />   }<br /><br />  $doc-&gt;load(&#039;rss.xml&#039;);<br />  $xpath = new DOMXPath($doc);<br />  $xpath-&gt;registerNameSpace(&#039;atom&#039;, &#039;http://www.w3.org/2005/Atom&#039;);<br /><br />?&gt;<br />&lt;ul&gt;<br />&lt;?php<br />  $nodo = $xpath-&gt;query(&#039;//atom:entry&#039;);<br />    $a = 0;<br />    foreach ($nodo as $nodo){<br />       $title = $nodo-&gt;getElementsByTagName(&#039;title&#039;)-&gt;item(0)-&gt;nodeValue;<br />       $link =  $nodo-&gt;getElementsByTagName(&#039;link&#039;)-&gt;item(0)-&gt;nodeValue;<br />       echo &quot;&lt;li&gt;&lt;a href=\&quot;&quot;.$link.&quot;\&quot; target=\&quot;_blank\&quot;&gt;&quot;.$title.&quot;&lt;/a&gt;&lt;/li&gt;<br />&quot;;<br />  }<br />?&gt;<br />&lt;/ul&gt;</pre><br /><br />PS: il file di cache &egrave; valido 8 ore, aggiusta il valore 28800 per modificarlo.]]></description>
<pubDate>Sat, 10 Jan 2009 00:22:46 +0100</pubDate>
<guid isPermaLink="false">http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28664</guid>
</item>
<item>
<title>A35G: [PHP] Document Object Model e leggere un RSS non è mai stato tanto facile</title>
<link>http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28662</link>
<description><![CDATA[Se vuoi un esempio, prendi il feed dell&#039;amico guelfo ;)]]></description>
<pubDate>Fri, 09 Jan 2009 19:46:24 +0100</pubDate>
<guid isPermaLink="false">http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28662</guid>
</item>
<item>
<title>A35G: [PHP] Document Object Model e leggere un RSS non è mai stato tanto facile</title>
<link>http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28661</link>
<description><![CDATA[Su una decina di blog che seguo tramite feed, gestiti da feedburner, 3 mi producono pagina bianca con qualsiasi script io decida di usare per parsare l&#039;xml]]></description>
<pubDate>Fri, 09 Jan 2009 19:44:13 +0100</pubDate>
<guid isPermaLink="false">http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28661</guid>
</item>
<item>
<title>davidonzo: [PHP] Document Object Model e leggere un RSS non è mai stato tanto facile</title>
<link>http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28660</link>
<description><![CDATA[Il file rss.xml viene sovrascritto solo se &egrave; pi&ugrave; vecchio del limite di cache gestibile.<br />Se anche a scadenza non viene sovrascritto, prova a controllare i permessi del file.<br /><br />Per feedburner che errori ti da? Io ne indicizzo un paio di FB in questo modo e non ho avuto problemi.]]></description>
<pubDate>Fri, 09 Jan 2009 19:28:00 +0100</pubDate>
<guid isPermaLink="false">http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28660</guid>
</item>
<item>
<title>A35G: [PHP] Document Object Model e leggere un RSS non è mai stato tanto facile</title>
<link>http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28659</link>
<description><![CDATA[Mmm...<br />Se il file rss.xml &egrave; presente...e anche se il sito &egrave; diverso...il file non viene sovrascritto...se lo elimino, funziona correttamente :D<br /><br />Poi alcuni feed di feedburner provocano sempre o quasi degli errori e non solo con il tuo script :(]]></description>
<pubDate>Fri, 09 Jan 2009 17:48:14 +0100</pubDate>
<guid isPermaLink="false">http://www.davidonzo.com/post/944/php-document-object-model-e-leggere-un-rss-non-e-mai-stato-tanto-facile/#comm28659</guid>
</item>
</channel>
</rss>

