Dernier ajout : 10 août 2006.
fonction
$url1, $path
10 août 2006, pargetFeed **************************** print_r (get_feed_from_url("spip-contrib.net")) ;
print_r (get_feed_from_url("http://liberation.fr/")) ;
print_r (get_feed_from_url("cnn.com")) ;
print_r (get_feed_from_url("http://willy.boerland.com/myblog/")) ;
***************************** Resultat *****************************************
Array
(
[0] => http://www.spip-contrib.net/backend.php
)
Array
(
[0] => http://www.liberation.fr/rss.php
)
Array
(
[0] => http://rss.cnn.com/rss/cnn_topstori...
[1] => http://rss.cnn.com/rss/cnn_latest.rss
[2] => http://www.cnn.com/services/rss/
[3] => http://www.cnn.com/services/rss/
[4] => http://www.cnn.com/services/rss/
)
Array
(
[0] => http://willy.boerland.com/myblog/at...
[1] => http://willy.boerland.com/myblog/bl...
[2] => http://willy.boerland.com/myblog/rss.xml
[3] => http://willy.boerland.com/myblog/no...
)
*********************************************************************** petite fonction qui prend en charge les problemes de double slash qunad on concatene les lien
fonction
$url, $buffer=false
10 août 2006, partest is_feed******************************
echo is_feed("http://spip-contrib.net/backend" _EXTENSIO_PHP") . "
" ; //retourne rss
echo is_feed("http://liberation.fr/rss.php") . "
" ; //retourne rss
echo is_feed("http://liberation.fr/rss.php") . "
" ; //retourne rss
echo is_feed("http://willy.boerland.com/myblog/at...") //retourne atom
echo is_feed("http://spip.net/") . "
" ; //retoune 0
//pas trouver d’exmples avec rdf j’ai encore du mal a saisir ce que rdf apporte de plus que rss
//mais bon j’ai pas aprofondi
***********************************************************
fonction sans finesse mais efficace
on parcourt ligne par ligne a la recherche de balise ou
si dans le corps de celle-ci on trouve les mots rss, xml, atom ou rdf
alors on recupere la valeur href=’
fonction
$url
10 août 2006, parest alors plus long une fonction qui permet de si un lien est un feed ou nom, si c’est un feed elle retourne son type si c’est pas un feed elle retourne 0, cette v�rification est �videmment tres tres l�g�re