Extend

Readsfeed is available for anyone to use and improve. It was developed through Yahoo Pipes and several RSS programs:

The Readsfeed pipe version: Yahoo Pipes
The PHP version: view/download source below
The publications list: Google Docs
Creating RSS feeds for sites that don’t have them: Feedity

Pipes manages basic but essential tasks: prefixing each feed item with the name of the source publication; making sure there are no duplicate items; limiting each feed to a reasonable number of items—which helps improve performance and also manage sites that publish lots of pieces all at once, such as the New York Review of Books, which publishes a dozen or more pieces all at once, once a month.

PHP source

Great credit is due to Brian Bell, who wrote the bulk of the PHP script. Right-click to download his PHP here…or simply view it:

/**
* ReadsFeed.com Y!Pipes Proxy
*
* This script will retrieve the latest version of a Yahoo! Pipes
* feed and rewrite the "link" value to a ReadsFeed.com address
*
* @author Brian Bell
*/


## First, see what output they want & validate
$render = (isset($_GET['render']) ? trim($_GET['render']) : 'rss' );
if ( !in_array($render, array('php','rss',null) ) ) {
die("Not a valid output format.");
}

// Base URI of the various Pipe feed renderings.
$pipe_uri = 'http://pipes.yahoo.com/pipes/pipe.run?_id=a70c5a49042c25eacfec63355901f6c4&_render=';

switch ( $render ) {

case 'php':

## Grab the pipe data, unserialize and process as needed.
if ( ($response = file_get_contents($pipe_uri.'php')) !== FALSE ) {
$pipe_data = unserialize($response);
$pipe_data['value']['link'] = 'http://readsfeed.com/';
}
else {
die('Request failed');
}

$output = serialize($pipe_data);

break;

case 'rss':
default:

## Grab the pipe data, modify the xml and reformat back to XML as an RSS feed
if ( ($response = file_get_contents($pipe_uri.'rss')) !== FALSE ) {
$rss_xml = simplexml_load_string($response);
$rss_xml->channel->link = 'http://readsfeed.com/';
}
else {
die('Request failed');
}

$output = $rss_xml->asXML();

break;

}

## Deliver the output
echo $output;

RSSinclude code

Lastly, RSSinclude is used to output text that is readable by search engines. This text is in a hidden div on the Readsfeed homepage. RSSinclude’s minor drawback is that it inserts ads into the feed, but these ads are presumed not prevalent enough to affect search results or one’s own contextual advertising.

<div id="hidden-output" style="display:none;">
<? readfile('http://www.rss-info.com/rss2.php?integration=php&windowopen=1&rss=http%3A%2F%2Freadsfeed.com%2Ffeed%2F&number=20&width=300&ifbgcol=FFFFFF&bordercol=D0D0D0&textbgcol=F0F0F0&rssbgcol=F0F0F0&showrsstitle=1&showtext=1'); ?>
</div>

Feedback

Specific feedback always needed includes, but is not limited to:

  • Does it work for you in your RSS reader of choice?
  • If you embed the feed on your website, how long does it take to load?
  • What literary websites would you like to see added?

Please provide feedback by commenting below or emailing Andrew directly.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

-->