It is currently September 26th, 2020, 2:34 am

FeedReader RSS/Atom plugin v2.0 - Atom Support and more!

Share and get help with Plugins and Addons
slartibartfast
Posts: 15
Joined: September 10th, 2012, 3:42 pm

FeedReader RSS/Atom plugin v2.0 - Atom Support and more!

Post by slartibartfast »

Image
When I originally wrote my multiFEED skin its performance was severely diminished by the huge number of regular expressions the skin needed to execute with WebParser to extract the feed data. WebParser's lack of dynamic variable support also greatly complicated the design and execution of MultiFEED 1.0. For multiFEED 2.0 I wrote this plugin.

Rather than struggling with slow and cumbersome regular expressions, this new plugin reads RSS feeds as XML, which is inherently easy for a program (or human) to extract data from. A full RSS feed with fifty or a hundred (or a thousand) headlines can be read over a reasonably fast internet connection in less than one second.

This plugin fully supports dynamic variables, making it easy to write very sophisticated RSS skins with a minimum of fuss. Full documentation is included so you can use the FeedReader plugin in your own skins. If you like it, feel free to use FeedReader in your own released skins. (Creative Commons Attribution-NonCommercial-NoDerivs 3.0 license)

UPDATE: New release version 2.0! Lots of new features added, including:
  • - Atom news feed support!
    - Multiple channel support for RSS feeds.
    - Filter items by age, category, or language.
    - The custom child measure types now support XML attributes and namespaces.
    - New child measure types to provide feed type (RSS or Atom), feed language, and item language.
Version 2.1.0 adds automatic special character substitution, if desired. No more long and complicated Substitute= clauses. Handles 171 different special character codes.

IMPORTANT: I inadvertently uploaded a test version of the DLLs as version 2.1.0, which had special character substitutions disabled for RSS feeds. Sorry about that, it's what happens when you upload things when you are suffering the worst flu you've had in ten years. Version 2.1.1 fixes this. It also extends the ItemDesc child measure type to return the value of the item <content> nodes for Atom feeds. I recommend all FeedReader users upgrade to the latest version.

Download it now from my deviantART gallery. http://LimeyCanuck.deviantart.com
Last edited by slartibartfast on January 1st, 2013, 6:06 pm, edited 9 times in total.
User avatar
jsmorley
Developer
Posts: 21387
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New high-performance RSS feed reader plugin

Post by jsmorley »

Seems to work pretty well. Nice job.

Without the date/time of the item being available in some standard date format it wouldn't be something I could regularly use, as I like to have new items (new by my definition in seconds or minutes) highlighted. (I bring the raw data into Lua to do some extra parsing and actions there) Having said that, for most pretty simple RSS needs, I think this is quite good and may well meet the needs of many folks. Being able to avoid complex regular expressions is certainly going to be welcome to many.

I didn't test, but I assume this will handle both RSS and Atom feed formats?
slartibartfast
Posts: 15
Joined: September 10th, 2012, 3:42 pm

Re: New high-performance RSS feed reader plugin

Post by slartibartfast »

jsmorley wrote:Seems to work pretty well. Nice job.

Without the date/time of the item being available in some standard date format it wouldn't be something I could regularly use, as I like to have new items (new by my definition in seconds or minutes) highlighted. (I bring the raw data into Lua to do some extra parsing and actions there) Having said that, for most pretty simple RSS needs, I think this is quite good and may well meet the needs of many folks. Being able to avoid complex regular expressions is certainly going to be welcome to many.

I didn't test, but I assume this will handle both RSS and Atom feed formats?
Good point. I don't use date/time values myself, but I can see how they would be useful to others. I'll add this to the child measure types. Might even be today. :D

As for the RSS/Atom question, I don't know. I designed it for RSS feeds, and I don't know the Atom feed format, but I'll look into this too.

UPDATE: I'm also going to add feed language, and item categories to the child measure types. I think I can also create a special child type that allow extraction of user defined XML nodes. Check back in a day or two for version 1.0.1.

UPDATE2: So much was added that I bumped the new version up to 1.1.0... adds everything you mentioned except Atom feed support. On my deviantART gallery page now.
User avatar
thatsIch
Posts: 464
Joined: August 7th, 2012, 9:18 pm

Re: FeedReader RSS/Atom plugin v2.0 - Atom Support and more

Post by thatsIch »

wondering, does this support Lua?
€: tested it and it works like any normal Measure, though wished it would have any advanced Lua support like own functions to work with that, since in the end Lua is still far more easy to handle than using this plugin. You just need one webparser to download the file and the lua to parse it and process it directly. With that you just need one measure.
User avatar
jsmorley
Developer
Posts: 21387
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: FeedReader RSS/Atom plugin v2.0 - Atom Support and more

Post by jsmorley »

thatsIch wrote:wondering, does this support Lua?
€: tested it and it works like any normal Measure, though wished it would have any advanced Lua support like own functions to work with that, since in the end Lua is still far more easy to handle than using this plugin. You just need one webparser to download the file and the lua to parse it and process it directly. With that you just need one measure.
I think this is an alternative to using Lua in that way, not something that it makes sense to integrate with Lua in any way. While it is true that one method of parsing a feed is to download the entire site with RegExp=(?siU)^(*)$ and parse it in Lua, one that I use myself on just about every WebParser skin, it has some disadvantages as Lua can't handle Unicode characters, so any feed that is in a non-Latin character set is going to be impossible to do this way.

I don't understand how any attempt to integrate this plugin with Lua (real integration is just not possible) or what "functions" supporting Lua make any sense. You certainly can still get the value of any "child" measures created with the plugin in Lua, and do additional processing if you want or need.

I think if a user wants to use Lua to parse a site, that is fine. In fact, I encourage it. If not, if the user isn't interested in learning Lua, or wants to ensure that Unicode is supported, then I think this plugin is really full-featured and does everything it needs.
User avatar
thatsIch
Posts: 464
Joined: August 7th, 2012, 9:18 pm

Re: FeedReader RSS/Atom plugin v2.0 - Atom Support and more

Post by thatsIch »

True, the main drawback is the lacking Unicode support. Forgot about that.
clefranc
Posts: 1
Joined: December 13th, 2017, 12:33 pm

Re: FeedReader RSS/Atom plugin v2.0 - Atom Support and more!

Post by clefranc »

Hi,
Can you help me get the <summary> item for the below Atom feed?
I need : Émis à: 04h51 HNE mercredi 13 décembre 2017

Thanks

Christian

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
 <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr-ca">
 
<!--
Ce fichier contient des données destinées aux lecteurs ou agrégateurs RSS.
Pour en apprendre davantage au sujet du service RSS, veuillez vous rendre à http://www.ec.gc.ca/meteo-weather/default.asp?lang=Fr&n=11703207-1
-->

 <title>Fermont - Alerte Météo - Environnement Canada</title>
 <link rel="related" href="http://www.meteo.gc.ca/warnings/report_f.html?qc3" type="text/html"/>
 <link rel="self" href="http://www.meteo.gc.ca/rss/battleboard/qc3_f.xml" type="application/atom+xml"/>
 <link rel="alternate" hreflang="en-ca" href="http://www.weather.gc.ca/rss/battleboard/qc3_e.xml" type="application/atom+xml"/>
 <author>
 <name>Environnement Canada</name>
 <uri>http://www.meteo.gc.ca</uri>
 </author>
 <updated>2017-12-13T09:54:38Z</updated>
 <id>tag:meteo.gc.ca,2013-04-16:20171213095438</id>
 <logo>http://www.meteo.gc.ca/template/gcweb/v4.0.24/assets/wmms-alt.png</logo>
 <icon>http://www.meteo.gc.ca/template/gcweb/v4.0.24/assets/favicon.ico</icon>
 <rights>Droit d'auteur 2017, Environnement Canada</rights>
 <entry>
 <title>AVERTISSEMENT DE TEMPÊTE HIVERNALE EN VIGUEUR, Fermont</title>
 <link type="text/html" href="http://www.meteo.gc.ca/warnings/report_f.html?qc3"/>
 <updated>2017-12-13T09:51:00Z</updated>
 <published>2017-12-13T09:51:00Z</published>
 <category term="Alertes"/>
 <summary type="html">Émis à: 04h51 HNE mercredi 13 décembre 2017</summary>
 <id>tag:meteo.gc.ca,2013-04-16:qc3_w1:201712130951</id>
 </entry>
 </feed>
slartibartfast
Posts: 15
Joined: September 10th, 2012, 3:42 pm

Re: FeedReader RSS/Atom plugin v2.0 - Atom Support and more!

Post by slartibartfast »

Hello Christian... It's been years since I wrote this plugin so my memory might be faulty, but you should be able to get what you need with the ItemCustom measure.

Code: Select all

[MeasureItemSummary]
Measure=Plugin
Plugin=FeedReader
Parent=MeasureAtomParent
Type=ItemCustom
Path=summary
The "Path" value for ItemCustom measures is relative to the "/feed/entry" node so you only need to specify "summary" for Path.