|
Cookbook /
InlineRSSSummary: Allows insertion of an RSS feed's contents into a PmWiki page.
Version: 1.0
Prerequisites: None
Status: DRAFT
Maintainer: zkarj
Questions answered by this recipeHow can I display an RSS feed in a PmWiki page? DescriptionThese instructions are still in draft! OverviewThis recipe is based (heavily) on Cal Demaine's WordPress plugin "inlineRSS" available from his website. The RSS feed is fetched (from its URL or a cache) and transformed to PmWiki markup using an XSLT transformation. A default transformation is supplied. InstallationDownload the PMinlineRSS.zipΔ file and extract locally. It contains the following files + PMinlineRSS |-- PMinlineRSS.php |-- PMinlineRSS.xslt Copy the directory into your cookbook directory on your server and then add the following to your localization file
include_once('cookbook/PMinlineRSS/PMinlineRSS.php');
Now you're ready to go. UseThe full markup is (:inlineRSS feed="http://feeds.feedburner.com/ilounge" cachename=ilounge cachetime=15 altXSLT="myxslt.xslt":) The parameters are: feed="" cachename= cachetime= altXSLT="" NotesCustomizingYou may edit a few lines in PMinlineRSS.php if you wish, though this would only seem necessary if there are naming conflicts with the cache files. The lines are commented and thus self explanatory, at the top of the file: $cookbookpath = 'cookbook/PMinlineRSS/'; // Path to directory containing XSLT files $cachepath = 'pub/'; // Path to directory for cache files $fileprefix = 'cache_'; // What cache file names get prefixed with $xsltfile = 'PMinlineRSS.xslt'; // The default xslt file Note that cache file names are built from $cachepath + $fileprefix + cachename + ".xml" You can of course replace the XSLT file (or better still, add your own and use altXSLT to invoke it) but I recommend you start from the default file as there are some big gotchas with RSS versus RDF feeds which took me a while to master! Release Notes
CommentsHi, work great! but is there a way to choose the number of post you want to show? touann - 12/07/2007 When I attempt to create a page with an {:inlineRSS:) markup, I get a white screen, blank except for the words "No valid XSLT processor found." I installed everything exactly as it was written here and have tried pointing to several different feeds to see if any worked. Mike - 8/30/2007 I am pretty sure this requires PHP5 with the XSLT functionality enabled. I am getting the same error as above. Scott - 2/18/08 See AlsoContributors |