FeedList
From HasnoWiki
Contents |
Description
The FeedList plugin allows you to include external RSS/Atom feeds, and aggregate multiple feeds into one ordered feed.
Installation and Setup
Copy the feedlist.jar file to the WEB-INF/lib directory, along with the rome-0.6.jar (as a note feedlist works with rome 0.8) and jdom-1.0.jar.
In your global /WEB-INF/plugin.properties file, add the following lines:
feedlist=info.hasno.blojsom.plugin.feedlist.FeedList
feedlist-admin=info.hasno.blojsom.plugin.feedlist.admin.FeedListAdmin
In your /WEB-INF/<username here>/plugin.properties file
add feedlist to the html output chain:
html.blojsom-plugin-chain=meta, tag-cloud, date-format, .., feedlist
Downloading
Binary feedlist-20051211.zip
Source feedlist-20051211-src.zip
Configuration
There plugin supports two feed "types". Regular feeds, and aggregate feeds. There is also an automatic updater that will run at specified intervals. The plugin include an administrative plugin allowing for configuration via webpage.
Regular Feed Configuration
Create a file named feeds.properties in your blog home (/WEB-INF/username).
The file should contain the following lines:
FeedList=MyDel,MyFeedB
MyDel_url=http://del.icio.us/username
MyDel_cnt=10
MyFeedB_url=http://www.slashdot.org/index.rdf
MyFeedB_refresh_hours=1
MyFeedB_refresh_minutes=30
FeedList is a comma delimeted list of feed names.
Each feed listed in the FeedList should at the very least have an _url entry, which is the feed's url (surprising eh?).
The _cnt entry is used to limit the number of entries displayed.
_refresh_hours and _refresh_minutes are used with the caching system, they tell it how long to keep a feed's data around before fetching from the url again.
Aggregate Feed Configuration
FeedList=MyFeeds,cnn,slash,del
MyFeeds_aggfeeds=cnn,slash,del
MyFeeds_cnt=10
del_url=http://del.icio.us/username
del_cnt=10
slash_url=http://www.slashdot.org/index.rdf
slash_refresh_hours=1
slash_refresh_minutes=30
cnn_url=http://rss.cnn.com/rss/cnn_topstories.rss
cnn_refresh_minutes=30
Aggregate feeds are established through the addition of the _aggfeeds property, which is a comma delimeted list of feed names.
The aggregate feed itself (MyFeeds in this example) does not have a refresh of any sort, it instead relies on the individual feed's refresh times. Aggregate feeds are sorted by date, newest entries first.
Updater Configuration
In blojsom.properties set feedlist_monitor_interval=60 or however many minutes the updater should run after. The default is 60 minutes.
It is suggested that the feed times be set to the same time period as this interval for best operation.
Template Configuration
The plugin will add a variable per feed, the variable will be prepended with "FEED_" and the feed's name will be converted to upper case.
The feed variable's getFeedEntries method will return an arraylist containing SyndEntry objects.
You will need to add the following to your templates:
Template Configuration (individual feed)
#if($FEED_MYDEL)
<div id="segydel" class="feedlist">
<h5><a href="http://del.icio.us/username" alt="my del.icio.us">my del.icio.us links</a></h5>
<ul>
#foreach($entry in $FEED_MYDEL.getFeedEntries())
<li>
#if($entry.getLink())
<a href="$entry.getLink()" alt="$entry.getTitle()">
#end
$entry.getTitle()
#if($entry.getLink())
</a>
#end
#if($entry.getDescription()) <br/><h1>$entry.getDescription().value</h1>
#end </li>
#end
</ul>
</div>
<br /><br />
#end
Template Configuration (aggregate feed)
#if($FEED_MYFEEDS)
<div id="segydel" class="feedlist">
<h5>feeds for your head</h5>
<ul>
#foreach($entry in $FEED_MYFEEDS.getFeedEntries())
<li>
#if($entry.getLink())
<a href="$entry.getLink()" alt="$entry.getTitle()">
#end
$entry.getTitle()
#if($entry.getLink())
</a>
#end
#if($entry.getDescription()) <br/><h1>$entry.getDescription().value</h1>
#end </li>
#end
</ul>
</div>
<br /><br />
#end
