User:JRWR/CitadelFeed

From PCGamingWiki, the wiki about fixing PC games

Yes, its hackish. Yes, It does work :)


<?php http_send_content_type('application/xml'); echo'<?xml version="1.0"?>'; date_default_timezone_set('America/Los_Angeles');?>
<rss version="2.0">
<channel>
<title>Citadel Project Feed - PCGamingWiki - JRWR</title>
<link>http://pcgamingwiki.com/</link>
<description>download ALL THE THINGS!</description>
<language>en-us</language>
<pubDate><?php date('l jS \of F Y h:i:s A');?></pubDate>
<lastBuildDate><?php date('l jS \of F Y h:i:s A');?></lastBuildDate>
<generator>YourMom</generator>
<managingEditor>contact@pcgamingwiki.com</managingEditor>
<webMaster>contact@pcgamingwiki.com</webMaster>
<?php
$directory = '/var/www/citadelfeed/TORRENTS/';
$finalfeed = array();
$scanned_directory = array_diff(scandir($directory), array('..', '.'));
foreach ($scanned_directory as &$value) {
        echo "<item>";
        echo "<title>$value</title>";
        echo "<link>http://citadel.pcgamingwiki.com/TORRENTS/$value</link>";
        echo "<description>Citadel Project Torrent File: $value</description>";
        $mtime = date ("l jS \of F Y h:i:s A", filemtime("/var/www/citadelfeed/TORRENTS/$filename"));
        echo "<pubDate>$mtime</pubDate>";
        echo "<guid>http://citadel.pcgamingwiki.com/TORRENTS/$value</guid>";
        echo "<torrent>http://citadel.pcgamingwiki.com/TORRENTS/$value</torrent>";
        echo "</item>";
}
?>
</channel>
</rss>