SimplePie RSS Feed Integrator v0.1

Release Notes

This is an early beta of a RSS/Atom Feed Integrator. This version provides a simple widget for adding an external feed to a user's profile. The widget is called Blog by default but you change that in the languages file. 

I wrote this for users who wanted their own blog feed on their profiles. It would be simple to extend this to do a lot more. If there are any developers interested in working on this, let me know.

After setting up your feed, you may need to a do a hard refresh before the css takes over. I am not using an css specific to this widget so it should pick up your theme if the theme is complete (h4 and h2 are used, not much else).

The admin settings area has links for checking the permissions on the cache directory and a server compatibility test.

Oh, yeah, and a feature list...

Features:

  • RSS and Atom support (see SimplePie's documentation
  • Cache feeds so every page load doesn't require a fetch
  • Feed discovery (type in cnn.com and it picks up the feed - doesn't always work)
  • Users set basic options: number of entries, datetime stamp, include excerpt
  • Strips images and most html markup - is that a feature? ;)
  • Widget could be added multiple times to profile and dashboard
  • Thanks for this, it's just what I needed!  Tip to others, if you want to change the word "Blog" in the widget to something like "Your News Feed", make the change in en.php in mod/simplepie/language/ before you enable it from the adminstration facility.

  • great! this is a sophisticated addtion to elgg. thanks.

    'Blog' is not a good name/title for this widget. i'm quite happy with changing the language file, but maybe it could be customisable (or just changed)?

  • @Sadara - To make it customizable from the admin screen means would mean at least 1 additional database call per page. I don't think it is worth it when it is so easy to change.

  • Love it! Thanks for this.

    One question, perhaps it's me, but some feeds I use such as http://uk.playstation.com/rss/ show the date wrong.  So instead of the actual date of the item (say 5th February - 05/02/09), the day/month is reversed and simplepie interprets it as 2nd May 2009.  Where the date can't be resolved, e.g. 17/6/08, the feed shows 1st January 1970.  This doesn't happen with all feeds - the BBC feeds show correctly.  Am I doing something wrong? Is it a problem with the feed?  Can anything be done?

  • w3 has a feed validator that is helpful in figuring out what is wrong with feeds.

    UK Playstation feed results - the date part is not validating

    I don't think there is much that I can do about this since the SimplePie library is pulling the date/time information out of the feed. Just for grins I tried Google Reader on the feed and it handled it so I guess Google's code is more robust to bad feeds.

    You could point the webmasters of that site to the validation results and see if they change it.

  • Many thanks - I shall tell Sony!

  • 啊,下个试试  :)

  • @adclose - definitely on the second question. I stripped images in the first version because I didn't want to take the time at that moment to resize large images to fit within the widget.

    On the first question, what sort of refresh rate were you thinking of? I think right now I cache feeds and only check for updates every 30 minutes. This is done to keep the performance snappy. A refresh rate faster than once every 30 minutes isn't going to load anything new.

  • First widget name - this is a limitation of the Elgg framework. The name is set for all widgets early in the page creation (system init event). The only way within the current framework that I can think of to do this is with javascript. It's a hack and I'd have to think through the ajax issues.

    The rss/atom feeds are being cached per feed (again for performance) which means if 10 people subscribe to the cnn feed, there is only one cache on the server being updated. To do what you're talking about, I'd probably turn off caching and set the interval really low.

  • Is there a way to make the plugin display on the front page of the site before loggin in?

  • I have done this with some of the my plugins, but not this one. I've been working on a new release and will consider this.

  • Hello. I just made a minor hack to simplepie : added proxy support

    If your server has to pass through a proxy it might be usefull.

    here is the modified file (line 7618) : http://www.perriot.fr/elgg/simplepie.inc

    You just have to add those line to engine/settings.php in order to enable the proxy :
        $CONFIG->proxy = "http://proxy";
        $CONFIG->proxy_port = "8080";

    Regards

  • Thanks for the note. Changing the default timeout in the function declaration doesn't actually do anything though. It is set elsewhere. I'll include instructions in my next version for changing the timeout on feeds.

  • @Cash: to set the header or title of a widget, we use:

                // little dirty way to set the title of this widget instance (note:  We could not get $(this)  as it is a JSON call?, so we include an unique div is in this widget view )
                $('#widget<?php echo $vars['entity']->getGUID(); ?>').find('.collapsable_box_header h1').html(" This new title is better");

  • I find myself asking this for various widgets.  Once the widget is enabled, where does it appear for the users to use?  I don't see it.  Althought it claims compatibility with the site.  Ideas?

  • Very useful! Very Great! Many thanks to Cash.

Project Info

Stats

  • Category: Widgets
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 10728
  • Recommendations: 24

Other Projects

View Cash's plugins