It is currently March 28th, 2024, 4:57 pm

RSSHelp Addon

Share and get help with Plugins and Addons
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

RSSHelp Addon

Post by jsmorley »

Since we are going to be losing Google Reader on July 1st, and some folks have made use of Google Reader to create RSS/Atom feed skins, I thought I would create a little addon that might help those who are going to be making changes to their skins.

This can also be useful for those who are just getting started with creating an RSS/Atom feed skin in Rainmeter.

First, it will pay to keep handy the manual pages for WebParser:

http://docs.rainmeter.net/manual-beta/plugins/webparser
http://docs.rainmeter.net/tips/webparser-tutorial

Now for the addon and what it does:
RSSHelp.zip
(356.42 KiB) Downloaded 373 times
Unzip that file to any location you like and run it.
01.jpg
Simply paste in the URL for any RSS or Atom feed, and click the "Connect" button.

The program will download the HTML / XML for the feed, parse it to determine if it is RSS or Atom, and will create a text file with the "parent" measure and Regular Expression you need to read the site. It will also tell you in the comments of the text file how many "items" there are available in the feed.

This uses a look-ahead assertion approach, with a [Variables] of GetItem that you just add to the RegExp option of the parent WebParser measure.

Then there is an example set of "child" WebParser measures, showing how to get the Feed Title and Feed Link, as well as the Date, Link and Title for the first #GetItem# returned.
02.jpg
You can use this text file to help with creating your skin. Let's look at an example:
TestRSSHelp_1.0.rmskin
(1.04 KiB) Downloaded 244 times

Code: Select all

[Rainmeter]
Update=1000

[Variables]
GetItem=(?(?=.*<item>).*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<pubdate>(.*)</pubdate>.*</item>)
TitleSub="^\s+":"","<!\[CDATA\[":"","\]\]>":"","!\[CDATA\[":"","\]\]":""

[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=http://feeds.gawker.com/lifehacker/full
RegExp=(?siU)<title>(.*)</title>.*<link>(.*)</link>#GetItem##GetItem##GetItem##GetItem##GetItem#
UpdateRate=600

[MeasureSiteTitle]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
DecodeCharacterReference=1
StringIndex=1

[MeasureSiteLink]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=2

[MeasureItem1Date]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=5

[MeasureItem1Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=4

[MeasureItem1Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#TitleSub#
StringIndex=3

[MeasureItem2Date]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=8

[MeasureItem2Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=7

[MeasureItem2Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#TitleSub#
StringIndex=6

[MeasureItem3Date]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=11

[MeasureItem3Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=10

[MeasureItem3Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#TitleSub#
StringIndex=9

[MeasureItem4Date]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=14

[MeasureItem4Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=13

[MeasureItem4Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#TitleSub#
StringIndex=12

[MeasureItem5Date]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=17

[MeasureItem5Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=16

[MeasureItem5Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute=#TitleSub#
StringIndex=15

[ItemStyle]
W=290
H=17
X=5
Y=5R
FontSize=11
FontColor=255,255,255,255
ClipString=1
AntiAlias=1
DynamicVariables=1

[EvenStyle]
SolidColor=80,80,80,255

[OddStyle]
SolidColor=0,0,0,255

[MeterBack]
Meter=Image
MeterStyle=OddStyle
W=300
H=138

[MeterSiteTitle]
Meter=String
MeterStyle=ItemStyle | OddStyle
MeasureName=MeasureSiteTitle
Y=5
FontColor=209,255,211,255
LeftMouseUpAction=["[MeasureSiteLink]"]

[MeterItem1Title]
Meter=String
MeterStyle=ItemStyle | EvenStyle
MeasureName=MeasureItem1Title
LeftMouseUpAction=["[MeasureItem1Link]"]

[MeterItem2Title]
Meter=String
MeterStyle=ItemStyle | OddStyle
MeasureName=MeasureItem2Title
LeftMouseUpAction=["[MeasureItem2Link]"]

[MeterItem3Title]
Meter=String
MeterStyle=ItemStyle | EvenStyle
MeasureName=MeasureItem3Title
LeftMouseUpAction=["[MeasureItem3Link]"]

[MeterItem4Title]
Meter=String
MeterStyle=ItemStyle | OddStyle
MeasureName=MeasureItem4Title
LeftMouseUpAction=["[MeasureItem4Link]"]

[MeterItem5Title]
Meter=String
MeterStyle=ItemStyle | EvenStyle
MeasureName=MeasureItem5Title
LeftMouseUpAction=["[MeasureItem5Link]"]
03.jpg
As in the images above, I used the feed URL http://feeds.gawker.com/lifehacker/full in the RSSHelp.exe program. I then copied the information from the text file it created into my skin (TestRSSHelp.ini) and added some things to it.

I added four additional #GetItem# variables to the RegExp option, so it will retrieve a total of 5 "items".

Then I added the additional "child" WebParser measures for the additional four items, making sure I used the correct StringIndex option on each.

Then I just created some MeterStyle sections to simplify formatting my meters, and added a background meter, a meter for the site title, and meters for each of the five "Items"

The cosmetics are not really important to this. What I am trying to do is give you some help with creating that all-important RegExp option for any given RSS or Atom feed, without you having to manually parse the site.

=======================
I have by NO means tested this on every possible RSS and Atom site out there, however I have tested it on several dozen popular ones. If you run into an RSS/Atom feed that the addon can't handle, please post the URL to the feed here so I can take a look at it.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: RSSHelp Addon

Post by moshi »

nice!
how about including a default UpdateRate for those folks that choose not to read the docs?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RSSHelp Addon

Post by jsmorley »

moshi wrote:nice!
how about including a default UpdateRate for those folks that choose not to read the docs?
There is a built-in default of 600 (10 minutes), but yeah, that is probably worth adding just to remind folks.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RSSHelp Addon

Post by jsmorley »

Ok, I added the UpdateRate=600 to the parent measure, and moved DecodeCharacterReference=1 to the child measures where it is needed.

RSSHelp.zip updated in first post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RSSHelp Addon

Post by jsmorley »

A couple of things worth pointing out:

This is not intended (nor will it work) as a way to create a "generic" or "one size fits all" RSS or Atom feed skin. It is meant as a tool to create a working skin for any one given feed URL. You can't just use this on some RSS feed URL, build the skin, then just replace the URL for some other RSS feed and expect it to work.

It might.. However, it just as easily might not.

First, the standard for the tags for both RSS and Atom are "position independent". This means that the feed might be item/pubdate/link/title or it might be item/title/link/pubdate, or any other order of the tags. So a big part of what RSSHelp does is figure out the order of the tags on the site and adjust the RegExp accordingly.

The second is that there are almost as many feeds that "tweak" the standard (in other words are run by buttheads who can't read) as there are ones that faithfully adhere to it. RSSHelp tries to make allowances for the various broken formats I have run into as well.

Kaelri has created a Lua script approach that is in fact "generic" and can be used to create a plug-and-play feed reader skin. This is a very nice and powerful script. The only (but significant) downside is that Lua does not support Unicode, so any attempt to use it on a site that is not in standard ASCII or extended ASCII is going to fail. RSSHelp.exe does no parsing of the actual "data" in the RSS/Atom feed, and allows WebParser (which does understand Unicode just fine) to carry the weight. It should work on pretty much any site in any language.
User avatar
JamesSF69
Posts: 48
Joined: January 19th, 2015, 4:48 am
Contact:

Re: RSSHelp Addon

Post by JamesSF69 »

"The document C:\...\MeasureRSS.txt is in use by another application and cannot not be accesed."

It seems to be actually writing this file, but then it errors out like this

ONLY when WordPad is used as the default .txt editor. Weird. :confused:
Works fine since I changed the default .txt editor to NotePad++
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RSSHelp Addon

Post by jsmorley »

JamesSF69 wrote:"The document C:\...\MeasureRSS.txt is in use by another application and cannot not be accesed."

It seems to be actually writing this file, but then it errors out like this

ONLY when WordPad is used as the default .txt editor. Weird. :confused:
Works fine since I changed the default .txt editor to NotePad++
Wordpad? Are you kidding me? ;-)
User avatar
JamesSF69
Posts: 48
Joined: January 19th, 2015, 4:48 am
Contact:

Re: RSSHelp Addon

Post by JamesSF69 »

jsmorley wrote: Wordpad? Are you kidding me? ;-)
Funny guy 8-)
It shocked me too LOL, I Guess I don't deal with a lot of .txt files so it just defaulted to that.
Yeah, that's it, I'll stick to that story.......
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RSSHelp Addon

Post by jsmorley »

Image
jingegno
Posts: 4
Joined: October 23rd, 2012, 3:11 am
Location: Tampa
Contact:

Re: RSSHelp Addon

Post by jingegno »

Maybe a quick question...
Will this work with FaceBook?
Post Reply