}
    $feed = new DummySingleItemFeed($url);
}
////////////////////////////////////////////
// Create full-text feed
////////////////////////////////////////////
$output = new FeedWriter();
$output->setTitle(strip_tags($feed->get_title()));
$output->setDescription(strip_tags($feed->get_description()));
$output->setXsl('css/feed.xsl');
// Chrome uses this, most browsers ignore it
if ($valid_key && isset($_GET['pubsub'])) {
    // used only on fivefilters.org at the moment
    $output->addHub('http://fivefilters.superfeedr.com/');
    $output->addHub('http://pubsubhubbub.appspot.com/');
    $output->setSelf('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
}
$output->setLink($feed->get_link());
// Google Reader uses this for pulling in favicons
if ($img_url = $feed->get_image_url()) {
    $output->setImage($feed->get_title(), $feed->get_link(), $img_url);
}
////////////////////////////////////////////
// Loop through feed items
////////////////////////////////////////////
$items = $feed->get_items(0, $max);
// Request all feed items in parallel (if supported)
$urls_sanitized = array();
$urls = array();
foreach ($items as $key => $item) {
    $permalink = htmlspecialchars_decode($item->get_permalink());
$output = new FeedWriter();
if (_FF_FTR_MODE === 'simple') {
    $output->enableSimpleJson();
}
//$feed_title = $feed->get_title();
//echo $feed_title; exit;
$output->setTitle(strip_tags($feed->get_title()));
$output->setDescription(strip_tags($feed->get_description()));
$output->setXsl('css/feed.xsl');
// Chrome uses this, most browsers ignore it
$ttl = $feed->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'ttl');
if ($ttl !== null) {
    $ttl = (int) $ttl[0]['data'];
    $output->setTtl($ttl);
}
$output->setSelf(get_self_url());
$output->setAlternate($url, 'Source URL');
$output->setRelated('http://www.subtome.com/#/subscribe?feeds=' . urlencode(get_self_url()) . '&back=' . urlencode(get_self_url()), 'Subscribe to feed');
$output->setLink($feed->get_link());
// Google Reader uses this for pulling in favicons
if ($img_url = $feed->get_image_url()) {
    $output->setImage($feed->get_title(), $feed->get_link(), $img_url);
}
////////////////////////////////////////////
// Loop through feed items
////////////////////////////////////////////
$items = $feed->get_items(0, $max);
// Request all feed items in parallel (if supported)
$urls_sanitized = array();
$urls = array();
foreach ($items as $key => $item) {