|
Cookbook /
RssFeedDisplaySummary: How to add an RSS feed to a page
Version: 2011-11-30
Prerequisites:
Status:
Maintainer: Anomen
Categories: RSS
Discussion: RssFeedDisplay-Talk
Questions answered by this recipeAdding an RSS feed to your page. DescriptionUse 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. InstallationYour 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 include_once("cachingCreate a cache-directory $MagpieEnableCache = true; SecurityPlease 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. Usage(:RSS http://example.com/rss.xml [long|short] [noheader] [number_of_items] :) Parameters
This will display the items in a default display mode with a default maximum of items: (:RSS http://example.com/rss.xml :) To display a short format and a max of 5 items use: (:RSS http://example.com/rss.xml short 5 :) ConfigurationList of configuration variables with their respective default values:
EncodingTo 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 include_once("scripts/xlpage-utf-8.php");
Be warned that it breaks special characters you already have in existing pages. See PmWiki:Internationalizations for details. Change log / Release notes
See also
LinksContributorsCommentsSee 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. |