Very short trick: proxy RSS with SimplePie

If you use Flash or Ajax to read RSS feeds from other domains, you need to equip yourself with a proxy (tunneling) because of the protections imposed by both technologies (see tunneling and proxy server for Ajax and not only ). If your site or blog is already present SimplePie , you can write a simple proxy in this way:

1
2
3
4
5
6
; require_once "simplepie.inc";

new SimplePie ( ) ; $ Feed = new SimplePie ();
set_feed_url ( 'http://www.undolog.com/feed' ) ; $ Feed -> set_feed_url ('http://www.undolog.com/feed');
enable_xml_dump ( true ) ; $ Feed -> enable_xml_dump (true);
init ( ) ; $ Feed -> init ();

This file (eg proxy.php) you can send GET the url of the feed you want to read:

1
2
3
4
5
6
; require_once "simplepie.inc";

new SimplePie ( ) ; $ Feed = new SimplePie ();
set_feed_url ( $_GET [ 'feedurl' ] ) ; $ Feed -> set_feed_url ($ _GET ['feedUrl']);
enable_xml_dump ( true ) ; $ Feed -> enable_xml_dump (true);
init ( ) ; $ Feed -> init ();

Using the call proxy.php?feedurl=http://www.cnn.com/feed

One Response to: " "

  1. December 22, 2008 Wordpress Plugin: Flash Feed Scroll Reader | Undolog.com :

    [...] First Plugin WordPress weblog Saidmade. Flash Feed Scroll Reader uses SimplePie PHP to create a proxy to access the different feed addresses. For the effect of scroll I chose Flash for a [...]

Leave a comment

TAG XHTML PERMITS: CODE ENTRY:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL