Blog Pile

Tasty feeds with PHP

Via open artifact cam this link to MovableBlog’s Integrating with PHP and Magpie describing a way to embed the output of your links in a web page. As always, there are many paths to the same destination.

As frequent readers know, this can be achieved via the JavaScript approach using our Feed2JS service or standalone code. Of course there is a round trip delay for this as a PHP script must be called which then fetches a fresh feed from the source (or loads a cached one). Or maybe JavaScript is just too clumsy for your tastes,

If you are on a PHP capable server, you can install Magie (which you need to do with the approach described via MovableBlog), but if you also use our PHP version of Feed2JS you can achieve the same effect.

The advantage of our approach over the one described above is that it can be repeated quite easily just by creating new shorter series of include statements. For example, below I will use it with my del.ici.ous RSS feed, but 3 weeks ago I used a different set of parameters to the same code. Feed, Rinse, Repeat.

All I need to make a feed here is to use

which gives us…

And I can just as easily add another just as quickly, say may furl feed to the same page:

which gives us…

If this kind of stuff has any value, please support me monthly on Patreon or a one time PayPal kibble toss


  1. Alan – When I view the source of your feed2js created page, I am abale to see the HTML source. When I view the source of my feed2js created page, all I see is the SCRIPT tag – I don’t see the result of the processing. What gives?

  2. Because the examples above are not generated by the JavaScript approach (which echos a series of document.write commands returned as a .js source file) but by direct include of php statements which output raw HTML to the page.

  3. After I did a little more looking, that’s what I figured, Alan. You’re using the .inc file.

    Before I dig further: have you, or anyone, come up with a working method to include the .inc calls across a http request? To include the feeds in WebCT or Blackboard (servers not supporting PHP directly), we’ll need to pass the requests to another PHP-friendly server.

    I ask, as the Javascript version is not 508 accessible. The PHP .inc results can be. We need a way to fully write the contents of a feed back to a page that resides on a server not supporting PHP.

  4. Wow! Wow! Wow!

    Alan, your Feed2js is supurb! I installed the stand alone on my server, following your clear instructions precisely and it works like a charm! Bravo!

    One question though, what is the best way to include multiple feeds? Should I initiate a new script for each, or can I place multiple feeds within one instance of the javascript?

    Thanks again. You’re brilliant.

  5. I cannot see an easy way to include dynamic content into such pages– you may have to look at something like server side includes which would require writing something completely new to do the parsing and dispaly of RSS content.

    However, I am not sure about the statement of not being 508 compliant. The JavaScript is ignored, but Feed2JS includes a NOSCRIPT tag that links to an HTML generated version of the feed (thus not embedded in the page, but still available to the user).

    Try turning off JS in your browser to see how it works.

  6. Roch,

    Thanks- multiple insertions of feeds would require a separate Feed@JS chunk of cod eper page. This could be a hit on your time to load pages;l I have done as many as 3 and there is a lag for the content to load. Your mileage may vary.

    If your server runs PHP, however, you can speed it up a bit by using the method described in this post, which has 2 different sets of feeds on the same page.

Comments are closed.