Recent Changes - Search:




Summary: How to add an RSS feed to a page
Version: 2011-11-30
Maintainer: Anomen
Users: (View? / Edit)
Categories: RSS

Questions answered by this recipe

Adding an RSS feed to your page.


Use the rss feed from another site, or your own, to be displayed on your wiki. For example, include the most recent changes. (That could also be done with a [include:RecentChanges]], but when using a parser you can easily change the look, or display only the top 10 changes.) This is also a good way to display images dynamically from Flickr.

This recipe uses RSS parser Magpie.


Your host must allow outgoing http requests.

How do I check if my host allows outgoing http requests?

Try to include an external url with this markup : IncludeUrl

Is this a setting I need to change in the Apache config file(s)?
Try it? ( I will try to make a test script soon)

Download rssdisplay.zipΔ. This archive already constains MagpieRSS.

Extract the archive into your PmWiki folder.

Add following line to local/config.php:



Create a cache-directory $FarmD/cache to avoid having the rss feed fetched a zillion times a day. Ensure the directory is writable for the webserver (chmod 777). Add into local/config.php:

 $MagpieEnableCache = true;


Please note that this recipe is inherently insecure. Never allow untrusted users use RSS markup, they could include feed with malicious content. Also be sure to add only trustworthy feeds.


 (:RSS [long|short] [noheader] [number_of_items] :)


display only titles (short) or also descriptions (long) of feed items
number of items to display, -1 means all items
noheader will hide header of feeds

This will display the items in a default display mode with a default maximum of items:

(:RSS :)

To display a short format and a max of 5 items use:

(:RSS short 5 :)


List of configuration variables with their respective default values:

default number of displayed items of feed (default 30)
default format of displayed items of feed (default 'long')
cache directory ("$FarmD/cache")
cache item timeout (2 hours)
proxy server, use syntax hostname:port
timeout for fetching RSS feeds (15)
use gzip compression for fetching feeds
directory where Magpie is installed ("$FarmD/cookbook/magpie")
encoding of content produced by feed reeder (defaults to $Charset)
output error messages from Magpie.


To properly display non-ASCII characters you need to define proper encoding of PmWiki pages. The best way is to swich PmWiki to Unicode by inserting this line at the beginning of local/config.php:


Be warned that it breaks special characters you already have in existing pages.

See PmWiki:Internationalizations for details.

Change log / Release notes

2011-11-30 New rewritten version (Anomen)
2005-10-301.32Added html_entity_decode for the rss-url (thanks to JohnCooley?)
  Added some utf8 translation to html entities
  Cleaned the Comments & Bugs list below a bit
2005-10-181.31Looks like the htmlspecialchars stuff was not a good thing
2005-10-111.30replaced ',' with space as seperator;setting error_reporting to zero;cleaned up html output;added conversion htmlspecialchars
2004-12-13 Pmwiki 2.0 beta
2004-05-161.14Magpie 0.61 basic atom support
2004-01-121.4Using new Keep function
Added <ul> to meet xhtml validation
2004-01-121.2Added more ways to display the feed.
2004-01-101.0Initial version.
archived documentation
git repository

See also




See discussion at RssFeedDisplay-Talk.

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on December 05, 2011, at 08:36 AM