<?
header('Content-type: text/xml; charset=UTF-8');
$file = 'papers.xml';
$mtime = filemtime($file);
$pubDate = gmdate("D, d M Y H:i:s", $mtime).' GMT';
header("Last-Modified: $pubDate");
$etag = md5_file($file);
header("Etag: $etag");
# previously encoding was ISO-8859-1. Switching to Unicode.
print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<rss version=\"2.0\">
<channel>
<title>Social Computing Lab : HP Labs : Latest Results</title>
<link>http://www.hpl.hp.com/research/scl/</link>
<description>Recent papers from HP Labs' Social Computing Lab</description>
<language>en-us</language>
<pubDate>$pubDate</pubDate>
<lastBuildDate>$pubDate</lastBuildDate>

";
$lines = file($file);
$l = 0;
$c = 0;
while ($l < count($lines) && $c < 10)
{
	print $lines[$l];
	if (preg_match("/\<\/item\>/", $lines[$l])) { $c++; }
	$l++;
}
print "</channel>";
print "</rss>";
?>
