Quote:
Originally Posted by over38
Wow awesome ! Any way to add a thumbnail or image?
|
Sure thing. Here is the code:
Code:
<?php
if (isset ( $_GET ["dump"] )) {
$dump = file ( $_GET ["dump"] );
$time = time ();
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<rss version=\"2.0\">\n";
echo "<channel>\n";
echo "<title>My Feed</title>\n";
foreach ( $dump as $item ) {
list ( $title, $desc, $thumb, $url ) = explode ( "|", trim ( $item ) );
echo " <item>\n";
echo " <title>" . $title . "</title>\n";
echo " <link>" . $url . "</link>\n";
echo " <guid>" . $url . "</guid>\n";
echo " <pubDate>" . date ( "D, d M Y H:i:s O", $time ) . "</pubDate>\n";
echo " <description><![CDATA[" . $desc . "]]></description>\n";
echo " <enclosure url=\"" . $thumb . "length=\"5\" type=\"image/jpeg\" />\n";
echo " </item>\n";
$time -= 86400;
}
echo "</channel>\n";
echo "</rss>\n";
}
?>
The appropriate dump format:
{title}|{description}|{thumb}|{url}
BTW, if there are affiliate programs owners who want supply their affiliates with VALID XML and RSS feeds of their picture/video galleries and FLV/MP4 files (in TubeAce and SmartScripts formats for tubes) - don't hesitate to contact me.
P.S. I can even make these feeds morphing (titles, descriptions and images).
