Skip to content

Instantly share code, notes, and snippets.

@jetbalsa
Last active April 9, 2017 15:57
Show Gist options
  • Save jetbalsa/968d2a8a32618d88d481c065be97466f to your computer and use it in GitHub Desktop.
Save jetbalsa/968d2a8a32618d88d481c065be97466f to your computer and use it in GitHub Desktop.
This script adds the "folder" child based off the show name so the shanaproject.com YaRSS Deluge Plugin can auto sort your shows off ShowRSS -- This PHP file is called like getfeed.php?id=43302 - so if your old feed url is http://showrss.info/user/43302.rss
<?php
header("Content-type: text/xml");
//setup globals
$dataurl = "http://showrss.info/user/" . preg_replace("/[^0-9]/", "",$_GET['id']) . ".rss";
$data = file_get_contents($dataurl);
$xml = new SimpleXMLElement($data);
foreach($xml->channel->item as $item){
$namespaces = $xml->getNameSpaces(true);
$tv = $item->children($namespaces['tv']);
$name = $tv->show_name;
$item->folder = $name . "/";
}
echo $xml->asXML();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment