Simple Feed List


Simple Feed List is a WordPress plugin that displays a list of entries from a valid RSS feed.

Download

Download Simple Feed List (v1.4, 08/07/2009)

Changelog

Version 1.0

  • Initial release

Version 1.1

  • Added ability to specify a maximum length for the description

Version 1.2

  • Check for CDATA within the title or description and strip out the tags if found. This resolves an issue where some feeds weren’t displaying (especially those provided by FeedBurner)
  • Use alternative method to file_get_contents to read content of feed – this means that allow_url_fopen does not need to be switched on in users PHP configuration. This has also improved performance of the plugin – it is now approx. 50% quicker

Version 1.3

  • Ok, that last fix didn’t go as well as I hoped – my new file routine turned out not to be compatible with PHP 4. This fix replaces it with an alternative version which is.

Version 1.4

  • CDATA removed from URL links

Installation

  1. Upload the entire simple-feed-list folder to your wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. There is no options screen.

Configuration

This is a very useful sidebar addition, as it can be used to display all sorts of useful information in a list format – news updates, site updates, software updates, etc. All you need is the URL of the RSS feed.

To display an RSS feed on your WordPress site you will need to insert the following code, where appropriate, into your theme…

<?php simple_feed_list('listurl','limit','descflag'); ?>

Where..

listurl : This is the URL of your RSS feed

limit : The number of items to display from 1 to 20 (default is 5)

descflag : This indicates whether you wish to display the description on the line below. This should be “Yes” or “No” or a numeric length. If left blank, it will assume to be “No”. If a number is specified this will be used as the maximum length of the description

This will then display a list of entries from the RSS as an HTML list (i.e. with `<li>` and `</li>` around each entry).

An example would be…

<?php simple_feed_list('http://images.apple.com/trailers/home/rss/
newtrailers.rss','5',''); ?>

This would display a list of the latest 5 movie trailers from the Apple site. Descriptions will not be shown.

<?php simple_feed_list('http://images.apple.com/trailers/home/rss/
newtrailers.rss','5','200'); ?>

This would display a list of the latest 5 movie trailers from the Apple site. Descriptions will be shown, up to a maximum length of 200 characters.

The following is an example of how it could be used, with a `function_exists` check so that it doesn’t cause problems if the plugin is not active…

<?php if (function_exists('simple_feed_list')) : ?>
<h2>Latest Apple Movie Trailers</h2>
<ul><?php simple_feed_list('http://images.apple.com/trailers/home/rss/
newtrailers.rss','5',''); ?></ul>
<?php endif; ?>

If you specify a limit of just 1, then the <li> tags will not be used, allowing you to embed the result in a sentence. For example, you could use a feed of quotes and use this to just display the latest quote.

Some Example Feeds

http://images.apple.com/trailers/home/rss/newtrailers.rss – the latest movie trailers from the Apple website
http://feeds2.feedburner.com/filehippo – latest software updates from FileHippo.com
http://feeds2.feedburner.com/quotationspage/qotd – quote of the day

Problems/Queries

Please report any problems, or suggestions for enhancements, to me either via my contact form or by commenting on the appropriate entries on my blog.

Updates

Updates to this and any other of my WordPress plugins will be published on this blog.

Subscribe to my WordPress category feed.


Share with Delicious Share with Digg Share with Facebook Share with LinkedIn Share with MySpace Share with reddit Share with StumbleUpon Share with Twitter

Comments


  1. I tried your plugin but I keep getting the following error:

    Warning: file_get_contents(): URL file-access is disabled in the server configuration in /home/content/a/n/t/anthonyv/html/omniai910/omnia/i910/wp-content/plugins/simple-feed-list/simple-feed-list.php on line 34

    Warning: file_get_contents(http://images.apple.com/trailers/home/rss/newtrailers.rss): failed to open stream: no suitable wrapper could be found in /home/content/a/n/t/anthonyv/html/omniai910/omnia/i910/wp-content/plugins/simple-feed-list/simple-feed-list.php on line 34
    # Simple Feed List Plugin : The supplied file does not seem to be in the RSS format.

    Here’s a link to the page:

    http://www.omniai910.com/omnia/i910/contact/


  2. Anthony,

    Thanks for letting me know about this. It’s down to a PHP configuration error on your host server. I’ve written further details, including how to fix it in a new blog entry.


  3. Hi David – great little plugin you’ve made. I’m trying to use it in my sidebar at http://www.tributary.ca/

    2 Questions:
    1. Can I adjust the length of the description – if so, how?
    2. I am getting a curious blank/empty marker at the beginning of the list – any idea why this might be happening.

    I am completely new to this whole WP thing so your help is appreciated.

    Nice work!


  4. Hi Andy,

    Glad you like it.

    1. Not at the moment – unless you change the plugin code. If you want me to show you how to do this, let me know. In the meantime I’ll add it to the list of to-do’s for the next version!
    2. Ok, if you can tell me where on the site (page and location on page) you’re using it I can take a look at the generated code and be able to work it out – again, let me know.


  5. Hi there,

    First of all, Thanks for such a nice plugin. It is running perfectly.

    I now want to include the images within the source posts/feeds to the end results.

    Is there a way to do this?


  6. Thanks for the reply. Sadly, there is no facility to do this as it’s designed for simple text links – hence images and the such are removed to present a clean result.

    If you open up the plugin code simple-feed-list.php and find line 91…

    if ($desc_flag=="Yes") {echo "".strip_tags(htmlspecialchars_decode($desc));}

    Then change it to…

    if ($desc_flag=="Yes") {echo "".$desc;}

    Then this MAY work, but I haven’t tested it.


  7. The install was easy, and the link to the feed I am drawing from seems to be in place. But I don’t see any text. I see the bullets, and the style is the same as the list above the feed that shows up fine. The more link takes me to the correct page. So…

    Any idea why this feed would not be displaying the text?


  8. Thank YOU for your reply David,
    Unfortunately that didn’t work, but no worries, I got what I initially wanted. I guess that sometimes we get too picky :-)

    Keep up the good work!


  9. Hi Rick, Can you let me know the feed URL that you’re using and I’ll try it out?


  10. Hi. I’ve set it up in WordPress, trying to pull from my Twitter account, but the RSS feed is returning this error: “Simple Feed List Plugin : The supplied file does not seem to be in the RSS format.”

    Here is the source feed in question:

    http://twitter.com/statuses/user_timeline/6943192.rss

    Thanks for any assistance you can provide.


  11. Marc, I’ve taken a look at this and tried it out… it appears to work. The code I used in my sidebar (to display the first 5 entries) was…

    <?php if (function_exists('simple_feed_list')) : ?>
    <h2>Marc's Twitter</h2>
    <ul><?php simple_feed_list('http://twitter.com/statuses/user_timeline/
    6943192.rss','5',''); ?></ul>
    <?php endif; ?>

    If the error message that you gave appears, this simply means that the header doesn’t state that it’s an RSS feed – the Twitter feed in your URL does contain this.


  12. Thanks for the quick response, David. I popped the code in my sidebar template, and still got the same error. I’ll dig around a little more and see if I can sort out what’s up.


  13. The only thing I could suggest is that your feed is coming from a different Twitter server from mine and is formed differently. Try looking at the underlying XML for the feed and see if, like mine, the second line starts with <RSS – a line beginning with this should mean the error you’re seeing shouldn’t be triggered.


  14. Dave,

    Would this work on a none WP page pulling feeds from a WP page?


  15. Yes it would – there is no WordPress dependency within the code.


  16. Hi there,

    Like Rick above, my feed is only showing the titles and no text description.

    And is there anyway to open the news in the same window?

    Thanks


  17. I’m investigating this, but it appears to be related to FeedBurner formatting. If this is happening, simply supply the raw URL of the feed – i.e. the one that FeedBurner is reading.


  18. Can’t get this wonderful plugin to work either, im supplying a correct rss feed with the <RSS on the second line, also tried your code, it still says The supplied file does not seem to be in the RSS format.

    Could there be a issue with something else? I don’t see why this wouldn’t work… I’ve tried atleast 10 different rss feeds now and all of them give me the exact same result.

    It says the exact same thing when using the example rss feeds in readme.txt, so there’s definitly something else that is wrong, no rss is valid for me. Could it be that some plugin is interupting this script or is my php missing some settings? I know i don’t have f_open on for security reasons, but i don’t get any complaints about that.


  19. I think i solved the issue allow_url_fopen is required in php for this script to work, but that comes with large security breaches that i didn’t want to cross, is there anyway else to call the rss feed without using fopen, cause the feed is localhost.


  20. Please provide me with an example feed URL, and I’ll try and find the cause for you.


  21. Thanks for the quick responds David! As i said earlier i got it to work when i enabled “allow_url_fopen” in php with your feeds in the readme.txt. However, my personal feed did not work, the output was blank. I’m guessing that the feed isn’t correctly output, but i was wondering if there’s anyway to modify the script to read the feed i want to use instead of changing the feed it self (probably alot harder.)

    This is the feed i wanted to use: http://dkeserver.se/ampache/rss.php?type=latestalbum

    It does validate in your script but as i said, the output is blank.

    Thanks alot for the help!


  22. It’s formatted fine, but like the aforementioned FeedBurner issue, all of the content is held within CDATA, which currently my plugin doesn’t recognise. This is something I will fix for the next release.


  23. Awesome, thanks for the hard work, i will donate to your cause!

    A question though, is it possible to run the script without having allow_url_fopen on? I’m guessing it should be possible cause the rss feed that i want to have on my wordpress is actually located on the same server. It could be found internally without supplying the http://mywebsite/application/rss instead just /application/rss…

    Thanks again for the help David. (and sorry for my lousy english)


  24. Hi David,
    A very powerful plugin! I have a question and hope you can help me.
    I would like to use this plugin to create an overview of the news in my niche (like some sort of news paper).

    Is there a way I can have the plugin retrieve the data once every few hours and cache the data in between?

    I’m asking this because I don’t want to retrieve the data for every person every single time they refresh (saves time and traffic I guess not to do that).
    Hope to hear from you if you have any thoughts on this.

    Again, love your work! Thanks!


  25. This is beyond the capability of the plugin at present. That’s now to say I won’t add such a facility later, but I think there are other, more important changs, to be making first ;) Keep an eye out though!


  26. Ok, Tomaí and drk – I’ve made a change to the plugin which will work with the feeds that you supplied. This was due to some feeds (including those provided by FeedBurner) holding their data with CDATA.

    I’ve not yet launched this new version, but keep an eye out for it (it will be version 1.2). I also want to look at the issue over the use of file_get_contents…


  27. Love the Plugin! having the same problem with the target defaulting to Target=”_blank”. Was wondering how I can change this open it in the same window. My feed is coming from my wordpress site and i am using it in one of my pages.


  28. Hi Andy, in the next version of the plugin I’ll add a facility to change this. I’ve also had a separate request about suppressing the “More” at the bottom of the list, so I’ll look at this too.


  29. Great plugin! Would it be possible to add an option to make all the links nofollow? Thanks.


  30. Excellent idea, and one I can apply to some of my other plugins too – watch this space!


  31. Your pulugin solved my problem about feed.
    Thank you very much !

    I have a question.

    My Site works on Multibyte (Japanese language)
    desc flag occuers encord problem in last word.
    how can I fix ?


  32. Hi David,

    Excellent plug-in, had it working fine locally, as soon as I uploaded the site to my server i get “Fatal error: Call to undefined function simple_feed_list()..” message.

    any ideas?


  33. As obvious as this sounds, this means that the Simple Feed List is not activated – your call to the routine isn’t working (and I’m assuming you haven’t put a check around your code to ensure that the plugin is active). Check your plugins screen again and make sure it’s 100% active.

    If you still can’t find the solution, send me a copy of the code you’ve used to call the plugin.


  34. I’m currently working on a new version of the plugin that will work better with international languages – stay tuned!


  35. yes it’s definitely activated – I am using the code example from your page –

    Latest Apple Movie Trailers

    although no joy – it takes a while to load then just displays the heading, and the rest of the page naturally fails as the php isn’t executing – this is really annoying as it was working fine locally.


  36. David, I found a small bug with your plugin when it encounters a feed that is not reachable. My proposed fix is discussed here:
    http://www.lifeatistudio.com/web-development/quick-fix-for-simple-feed-list-wordpress-plugin/


  37. Hi, I’m trying to insert a custom field function like this <?php get_post_meta($post->ID, 'RSS_feed', $single = true); ?> inside the RSS url location, but it is out putting an error. I was wondering if this is possible. Thanks!


  38. Hi Mike,

    If I’m understanding right, I think you’d need to do this…

    <?php simple_feed_list(get_post_meta($post->ID, 'RSS_feed',$single = true),'limit','descflag'); ?>

    Obviously, you’d need to replace ‘limit’ and ‘descflag’ with the appropriate options.

Pingbacks & Trackbacks

Leave a Comment

All these comments are validated before being placed on the site. I will NOT allow any spam to be shown, I do not follow the links myself and obvious self-promotion of your site is not accepted either.

CAPTCHA Image CAPTCHA Audio
Refresh Image