Bonjour,
je suis en train d'essayer de metre en place un podcast sur mon site. J'ai trouvé un script php qui me genere un flux rss selon ma base de donées. Ce script marche très bien pour des données écrite.
Le truc c'est que pour l'audio j'ai fais quelque modification.
Le script :
<?php
$xml = '<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0" xmlns:itunes="
http://www.itunes.com/dtds/podcast-1.0.dtd">';
$xml .= '<channel>';
$xml .= '<title>Podcast e-citron</title>';
$xml .= '<itunes:author>e-citron</itunes:author>';
$xml .= '<link>
http://www.e-citron.ch</link>';
$xml .= '<description>Le podcast pour une meilleur communication avec vous.</description>';
$xml .= '<itunes:subtitle>Les news de e-citron direct dans votre ipod.</itunes:subtitle>';
$xml .= '<itunes:summary>Le podcast pour une meilleur communication avec vous.</itunes:summary>';
$xml .= '<itunes
![:o :o]()
wner>';
$xml .= '<itunes:name>Podcast e-citron</itunes:name>';
$xml .= '<itunes:email>liou13@gmail.com</itunes:email>';
$xml .= '</itunes
![:o :o]()
wner>';
$xml .= '<itunes:category text="Public Radio"/>';
$xml .= '<itunes:keywords>radio multimedia</itunes:keywords>';
$xml .= '<language>fr-ch</language>';
$xml .= 'e-citron - 2006';
$jourdui= date("D, d M Y H:i:s +0100");
//Sat, 23 Apr 2005 00:01:00 +0100
$xml .= '<pubdate>'.$jourdui.'</pubdate>';
$xml .= '<image>';
$xml .= '<url>
http://127.0.0.1/podcast_audio/citron.gif</url>';
$xml .= '<link>
http://www.e-citron.ch</link>';
$xml .= '</image>';
$xml .= '<itunes:image>';
$xml .= '<url>
http://127.0.0.1/podcast_audio/citron.gif</url>';
$xml .= '</itunes:image>';
require ('connect.php');
// Vous pouvez soit faire appel à un fichier externe contenant
//toutes les infos de connexion à votre base et table
// ou vous pouvez écrire ici ces infos directement
$res=mysql_query("select * from audio order by date DESC limit 0, 5");
// extraction des 10 dernières nouvelles
while($lig=mysql_fetch_array($res)){
$titre=$lig[titre];
$adresse=$lig[url_fichier];
$temp=$lig[temp];
$madate=$lig[date];
$datephp=date("D, d M Y H:i:s +0100", strtotime($madate));
$xml .= '<item>';
$xml .= '<title>'.$titre.'</title>';
$xml .= '<link>
http://127.0.0.1/podcast_audio/index.php</link>';
$xml .= '<author>e-citron</author>';
$xml .= '<itunes:author>e-citron</itunes:author>';
$xml .= '<pubDate>'.$datephp.'</pubDate>';
$xml .= '<source url="
http://127.0.0.1/podcast_audio/fluxrss.xml"/>';
$xml .= '<description>Les news de e-citron direct dans votre ipod.</description>';
$xml .= '<enclosure "url"='.$adresse.' "type"=type="audio/mpeg" />';
$xml .= '<itunes
![:D :D]()
uration>'.$temp.'</itunes
![:D :D]()
uration>';
$xml .= '</item>';
}//fin du while
$xml .= '</channel>';
$xml .= '</rss>';
$fp = fopen("fluxrss.xml", 'w+');
fputs($fp, $xml);
fclose($fp);
echo 'Export XML effectue !<br><a href="fluxrss.xml">Voir le fichier</a>';
?>
Et le probleme est que la page xml crée a une erreur au niveau du <enclosure "url".
Voila si quelqu'un a une idée ce serai cool.
Merci