aks_rss
RSS parser and aggregator
download link / homepage / demo
Summary
aks_rss is an RSS parser plugin that fetches RSS feeds and shows the latest feed content inside TxP articles. It is possible to fetch multiple feeds and aggregate the content in one output. aks_rss uses SimplePie 1.1.3 with IDN support, see installation notes.
This plugin based on bit_rss 0.4.1 by Bit Santos.
aks_rss plugin compatibility with SimplePie Plugin for Textpattern
Installation
- Install this plugin.
- Copy simplepie.inc to textpattern/lib/ directory.
- If your need IDN support, just copy files from idn directory to textpattern/lib/ (IDN – Internationalized Domain Names)
- Make sure that the TxP tmp directory is writeable. This is where Simplepie will put its cache files by default.
Changelog
v0.1.1
- Rewrite some code for compatibility with last version Textpattern
- Rewrite code for compatibility with SimplePie 1.1.3
- Delete attributes ‘strip_ads’ and ‘replace_headers’ (SimplePie does not support them more)
- Add attribute
'target', 'limit_per_feed','offset_per_feed' - Add tags
<txp:author />and<txp:excerpt /> - Delete tag
<txp:bit_author />, please use<txp:author /> - BugFix: plugin bit_rss 0.4.1 destroy global variable $GLOBALS[‘thisarticle’]
v0.1.2
- Add support inline form.
<txp:aks_rss feed="http://abc.com/rss.xml">Output form here</txp:aks_rss>
v0.1.3
- Compatibility with SimplePie Plugin for Textpattern.
- Tag
<txp:feed>http://abc.com/rss.xml,http://def.com/rss2.xml</txp:feed>
- Tag
- Add css class for each feed
<txp:aks_rssclass /> - Add attributes
wraptag, id, class
v0.1.4
- Added admin interface in Extension tab
v0.1.5
- Add attribute
shortdesc– short item description to N words - Fix bad naming:
<txp:aks_rsstitle />renamed to<txp:aks_rss_title /><txp:aks_rsslink />renamed to<txp:aks_rss_link /><txp:aks_rssclass />– please, use other tag –<txp:aks_rss_source />
v0.1.6
- Add/fix attributes
wraptag,break - Add attributes
showtitle,alttitle,h - Add predefined form – attribute
simpleform
2do
Compatibility with SimplePie Plugin for Textpatternpossible DONE
Tags
<txp:aks_rss />
| attributes | default | sample | description |
|---|---|---|---|
| feed | ‘’ | 'http://feed1.us/rss' |
one or more feeds |
| simplepie | txpath.'/lib/simplepie.inc' |
‘’ | ‘’ |
| caching | ‘1’ | ‘’ | ‘’ |
| cache_dir | txpath.'/tmp' |
‘’ | ‘’ |
| cache_time | 60 | ‘’ | in minutes |
| encode_html | ‘1’ | ‘’ | ‘’ |
| strip_html | ‘’ | ‘’ | ‘’ |
| strip_atts | ‘’ | ‘’ | ‘’ |
| form | ‘rss’ | ‘’ | output form |
| simpleform | ‘’ | 'title' |
predefined form |
| shortdesc | all | ‘’ | short descriptions to N words |
| limit | all items | ‘’ | limit output items |
| limit_per_feed | all items | ‘’ | limit items per each feed |
| offset | ‘0’ | ‘’ | number of entries to skip in output. NOTE: Don’t use offset with limit_per_feed |
| offset_per_feed | ‘0’ | ‘’ | number of entries to skip per each feed |
| order | desc | asc | sort order |
| target | ‘’ | ‘_blank’ | href attribute |
| emptymsg | ‘No feed items could be found.’ | ‘’ | ‘’ |
| wraptag | ‘’ | ul |
‘’ |
| break | ‘’ | li |
‘’ |
| id | ‘’ | ‘’ | (X)HTML/CSS id |
| class | ‘’ | ‘’ | (X)HTML/CSS class |
| breakclass | ‘’ | ‘’ | (X)HTML/CSS class |
| showtitle | 0 | 1 | display feed title |
| alttitle | ‘’ | 'Some title' |
feed title |
| h | h3 |
h4 |
tag for feed title |
Example. ( == – disable Textile)
==<txp:aks_rss simpleform="title" showtitle="1" limit="2" feed="http://forum.textpattern.com/extern.php?type=RSS&action=active&fid=79" />==
or
==<txp:aks_rss wraptag="ul" break="li" showtitle="1" limit="2" feed="http://forum.textpattern.com/extern.php?type=RSS&action=active&fid=79"> <txp:permlink><txp:title /></txp:permlink></txp:aks_rss>==
Generate code:
<h3><a href="http://forum.textpattern.com/" target='_blank'>Textpattern CMS Support Forum</a></h3><ul> <li><a href="http://forum.textpattern.com/viewtopic.php?id=30263&action=new" target="_blank">aks_rss : RSS parser and aggregator</a></li> <li><a href="http://forum.textpattern.com/viewtopic.php?id=32447&action=new" target="_blank">arc_twitter</a></li> </ul>
Support inline form:
<txp:aks_rss> Output form here </txp:aks_rss>
Example.
==<txp:aks_rss feed="http://rss.news.yahoo.com/rss/topstories" wraptag="ul"> <li class="<txp:aks_rss_source />"><txp:permlink><txp:title /></txp:permlink><br /><txp:body /><hr/> <sub>(<txp:posted format="rfc822" />) <b><txp:aks_rss_title /></b></sub><br /><br /></li> </txp:aks_rss>==
Attributes:
feed
Comma-delimited list of URLs of the feeds to be used
Example: feed='http://domain1.net/blog/feed'
Aggregate example: feed='http://domain1.net/blog/feed,http://domain2.net/blog/atom,http://domain3.net/rss.xml'
target (optional)
href attribute target
Default: false
Example: target='_blank'
simplepie (optional)
Absolute path to the SimplePie class file (simplepie.inc).
Default: txpath.'/lib/simplepie.inc'
Example: simplepie='/var/www/httpdocs/textpattern/lib/simplepie.inc'
caching (optional)
Whether caching is enabled or not.
Caching is disabled if it is set to false, no, or 0.
Default: true
cache_dir (optional)
Absolute path to the SimplePie cache directory. This directory must be writeable.
Default: txpath.'/tmp'
Example: simplepie='/var/www/httpdocs/textpattern/tmp'
cache_time (optional)
The length of time (in minutes) that the cache files are stored before being refreshed.
Default: 60
strip_html (optional)
SimplePie strips potentially dangerous/annoying tags by default.
The list of tags to be stripped can be changed by setting this attribute to a comma-delimited list of HTML tags.
Default: 'base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'
strip_atts (optional)
SimplePie strips potentially dangerous/annoying attributes by default.
The list of attributes to be stripped can be changed by setting this attribute to a comma-delimited list of HTML attributes.
Default: 'bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'
encode_html (optional)
Sets whether or not to encode the HTML tags instead of stripping them
HTML tags will be encoded when this is set to ‘1’, ‘true’, or ‘yes’.
Default: ‘0’
form (optional)
Form to be used to display each item in the feed.
The article tags, <txp:title />, <txp:posted />, <txp:body />, <txp:author />, <txp:permlink /> will work normally in the form used. <txp:category1 />, <txp:category2 />, <txp:excerpt /> will also function normally with appropriate feeds.
Default: ‘rss’
simpleform (optional)
Predefined form.
Now support only two predefined form: title, body
limit (optional)
Maximum number of items to fetch.
Default: number of items in the feed
limit_per_feed (optional)
Maximum number of items to fetch per feed.
Default: all items
offset (optional)
Number of entries to skip.
Default: 0
order (optional)
Order of items based on date. asc (ascending – oldest first) or desc (descending – newest first).
Default: desc
emptymsg (optional)
The text to output if no feed items were retrieved.
Default: No feed items could be found.
Form Tags
<txp:aks_rss_title />
Article form tag. This tag outputs the title of the parent feed of the item.
Example: <txp:aks_rss_title />
<txp:aks_rss_link />
Article form tag. This tag outputs the link of the parent feed of the item. It can be used as a container tag or as a single tag. Its attributes are exactly like the attributes of permlink except for the title attribute – the title attribute of the resulting link will be the feed title by default.
Example 1: <txp:aks_rss_link />
Example 2: <txp:aks_rss_link><txp:aks_rss_title /></txp:aks_rss_link>
<txp:aks_rss_source />
Article form tag. This tag outputs the source of the parent feed. Useful for class or other
Example: class="<txp:aks_rss_source />"
<txp:aks_rssclass />
Article form tag. This tag outputs css class for each feed
Example: <txp:aks_rssclass />
Tags
<txp:feed> – compatibility with SimplePie Plugin for Textpattern
| attributes | default | sample | description |
|---|---|---|---|
| feed | ‘’ | 'http://feed1.us/rss,http://feed2.de/feed' |
or use <txp:feed>http://feed1.us/rss</txp:feed> |
| items | all items | ‘’ | limit output items |
| showdesc | ‘1’ | ‘’ | show descriptions |
| shortdesc | all | ‘’ | short descriptions to N words |
| showdate | ‘’ | ‘1’ | logical value |
| target | ‘_blank’ | ‘_blank’ | href attribute |
| txt1 | ‘’ | ‘prefix’ | text before item title |
| txt2 | ‘’ | ‘suffix’ | text affter item title |
| error | ‘No feed items could be found.’ | ‘’ | ‘’ |
| listtype | ul |
ol |
It’s wraptag(for compatibility ) |
| break | li |
‘’ | break tag |
| id | ‘’ | ‘’ | (X)HTML/CSS id |
| class | ‘’ | ‘’ | (X)HTML/CSS class |
| breakclass | ‘’ | ‘’ | (X)HTML/CSS class |
| showtitle | 1 | 0 | Determines whether the built-in feed title is displayed or not |
| alttitle | ‘’ | some title |
Displays a custom title in place of the feed’s built-in title |
| h | h3 | h4 | Define the html header used for the title |
Unsupported attributes from SimplePie Plugin for Textpattern: shortdesc, showtitle, alttitle, h