<? echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
 
<channel>
<title>The Tom Green Show - Live at the SModCastle</title>
<link>http://tomgreen.com/</link>
<language>en-us</language>
<copyright>2006-2010 Tom Green</copyright>
<itunes:subtitle>LIVE at 11 PM Eastern on tomgreen.com</itunes:subtitle>
<itunes:author>tomgreen.com - The Channel</itunes:author>
<itunes:summary>A weekly podcast starring Tom Green and celebrity guests, performed live in front of an audience at the SModCastle.</itunes:summary>
<description>A weekly podcast starring Tom Green and celebrity guests, performed live in front of an audience at the SModCastle.</description>
<itunes:owner>
<itunes:name>Tom Green</itunes:name>
<itunes:email>podcast@tomgreen.com</itunes:email>
</itunes:owner>
<itunes:image href="http://www.smodcastle.com/images/tomgreen.png" />
<itunes:category text="Comedy">
</itunes:category>
<itunes:category text="TV &amp; Film"/>
<itunes:explicit>yes</itunes:explicit>
 
<?php
$link = mysql_connect('localhost', 'ondemand', 'kb&bcq!w7');
if (!$link) {
   die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db('ondemand', $link);
if (!$db_selected) {
   die ('Can\'t use foo : ' . mysql_error());
}


$result = mysql_query("SELECT * FROM videos WHERE podcast = 1 AND flvdone = 1 ORDER BY id ASC");
while ($curvid = mysql_fetch_assoc($result)) {

	echo "<item>\n";
	echo "<title>" . htmlspecialchars($curvid['title']) . "</title>\n";
	echo "<itunes:author>Tomgreen.com</itunes:author>\n";
	echo "<itunes:subtitle>" . htmlspecialchars($curvid['shortDescription']) . "</itunes:subtitle>\n";
	echo "<itunes:summary>" . htmlspecialchars($curvid['description']) . "</itunes:summary>\n";
	echo "<enclosure url=\"" . htmlspecialchars($curvid['download']) . "\" length=\"" . $curvid['fileSize'] . "\" type=\"video/mp4\" />\n";
	echo "<pubDate>" . htmlspecialchars($curvid['podcastDate']) . "</pubDate>\n";
	echo "<itunes:duration>" . htmlspecialchars($curvid['duration']) . "</itunes:duration>\n";
	echo "<itunes:keywords>" . htmlspecialchars($curvid['keywords']) . "</itunes:keywords>\n";
	echo "<itunes:explicit>yes</itunes:explicit>\n";
	echo "</item>\n";

	}



?> 
 
</channel>
</rss>
