/*
This script produces a rss feed with links to all of the torrent files.
TODO:
Change the date
set the number of sessions
*/
require_once("xmlrpc_includes.php");
require_once("../inc/util.inc");
require_once("../inc/db.inc");
//start the db
db_init();
//sets the variable session, which is a list of sessions
$session = Java("burp.domain.Session");
$statusEnum = Java("burp.domain.Session\$queueStatus");
$offset = 0;
//gets last XX sessions
$sessionList = $session->getSessionsInQueue($statusEnum->QUEUE_COMPLETED, $offset, 15);
//echo the start of the xml file
echo '
Big and Ugly Render Project: torrents15
burp.boinc.dk
This RSS feed contains links to torrents created by burp for distrubuting files among users. To use this put this link into your torrent application (ex. vuze) ';
//now that we have vars set, the script runns the function buildItem for each of the sessions in the session list
foreach ($sessionList as $currentSession){
echo buildItem($currentSession);
}
//echo the xml closing
echo '';
//taken from session.php and changed outputs.
function buildItem($session){
$eventTypeEnum = Java("burp.domain.Session\$eventType");
$attachments = $session->getAttachmentFiles();
if (java_cast($attachments->size(), "integer")>0){
// We have attachments
foreach ($attachments as $attachment){
$item = ' '.basename($attachment->getClientPath()).'
'.XML_URL_BASE.'torrent_cache.php?fileid='.$attachment->getID().'
'.java_cast($session->getTimestamp($eventTypeEnum->RENDER_END), "integer").'BURP session file: '.basename($attachment->getClientPath()).'
';
}
}
return $item;
}
?>