It is currently April 27th, 2024, 10:42 pm

Can't figure out the RSS Feed

Get help with installing and using Rainmeter.
cham888
Posts: 3
Joined: July 31st, 2012, 3:00 pm

Can't figure out the RSS Feed

Post by cham888 »

Hey Community,
I really can't say that I am new to Rainmeter, as I have used it for a couple of years now, but I still can't figure out how to incorporate RSS feeds into skins and my frustration with it before had led me to ultimately give up on RSS feeds.

However, I now wish to give it another go, but I still can't seem to find any dedicated tutorials on how to do this nor has any of the advice regarding RSS feeds been exactly helpful to me since I am essentially a novice when it comes to that sort of thing.

Is there anyone that could tell me how it works or if there is any dedicated tutorial that I somehow overlooked in the search feed? Any help would be greatly appreciated.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Can't figure out the RSS Feed

Post by MerlinTheRed »

I'd try looking at a simple rss feed and going from there. The most complicated thing would be the regular expression used to parse the rss feed. You can use the Regular Expression Tester by jsmorley to make it easier. Enter the url of your rss feed there. You will see the xml source code of the feed, showing tags like <title>...</title> <link>...</link> etc. It's pretty well readable in most cases. If you look at the regular expression of an existing feed reader you will see how to get the text between those tags. You can then use that text by using WebParser measures in your skin.

This is just a short hint but I hope it helps a little.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Can't figure out the RSS Feed

Post by Mordasius »

cham888 wrote:... if there is any dedicated tutorial that I somehow overlooked in the search feed?
You could take a look at the WebParser Primer and then read through the WebParser Related Tips.

Once you have a feel for how the WebParser plugin and RegExps work, you should get hold of any RSS FeedReader and start changing things in the .ini file to see what happens and how to customise it to your needs. Come back here if run into any specific problems.
cham888
Posts: 3
Joined: July 31st, 2012, 3:00 pm

Re: Can't figure out the RSS Feed

Post by cham888 »

MerlinTheRed wrote:I'd try looking at a simple rss feed and going from there. The most complicated thing would be the regular expression used to parse the rss feed. You can use the Regular Expression Tester by jsmorley to make it easier. Enter the url of your rss feed there. You will see the xml source code of the feed, showing tags like <title>...</title> <link>...</link> etc. It's pretty well readable in most cases. If you look at the regular expression of an existing feed reader you will see how to get the text between those tags. You can then use that text by using WebParser measures in your skin.

This is just a short hint but I hope it helps a little.
Thanks the Regular Expression Tester was really helpful, but that was never really my problem. I had no issue obtaining the parsing information since most sites already do that much for you already. What I am not clear on, is how do I go about implementing the information I have into my skins. I have attempted to use other RSS feeds as a reference, but each one is quite different from the other as how they choose to implement their feeds and is overall very confusing for me.

Most of the feeds I've seen use inc. files instead of the parsing information I can't seem to figure out. Is there anything I am missing here?
cham888
Posts: 3
Joined: July 31st, 2012, 3:00 pm

Re: Can't figure out the RSS Feed

Post by cham888 »

Mordasius wrote:You could take a look at the WebParser Primer and then read through the WebParser Related Tips.

Once you have a feel for how the WebParser plugin and RegExps work, you should get hold of any RSS FeedReader and start changing things in the .ini file to see what happens and how to customise it to your needs. Come back here if run into any specific problems.
I have looked at that and studied it for a while. What I have a hard time figuring out is how I use this information to help set up RSS feeds for my skins.

Forgive me if I sound like I'm asking you to hold my hand through the process, but it's kind of gotten to that point where kicking kittens seems like a good idea and the process really just confuses me more.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Can't figure out the RSS Feed

Post by MerlinTheRed »

As far as I know almost all of the RSS reader skins use a very similar approach. They just display the news headlines as strings and add an action to those strings so that the url that comes with the feed item is opened in your browser.

You are correct that different feeds tend to have differently structured xml. This means that when you do it straightforward, you might have to change not only your regexp but also all your StringIndex values on all your WebParser measures. Kaelri did a universal feed reader that overcomes those problems, but that's a very complex approach: http://rainmeter.net/forum/viewtopic.php?f=99&t=9068

I can show you an example of one of my rss skins that is pretty basic. The RegExp gets the title, headline, description and url of the four latest (topmost in the xml file) rss entries of a german news website. String meters are then used to display the headlines. The Tooltips show the description of the item and clicking will open the corresponding url in your browser.

Code: Select all

[Rainmeter]
Update=1000
Author=MerlinTheRed
MiddleMouseUpAction=!Refresh #CurrentConfig#
Blur=1
BlurRegion=1,0,0,245,120

[Metadata]
Name=RSS Reader 1
Config=Metro
Description=A RSS reader
Instructions=Mouse over an item to show the title and description. Click to open in browser.
Version=1.00
Tags=RSS | News | Feed | Newsfeed
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Preview=
Variant=

[Variables]
BackgroundColor=0,0,0,204
PrimeColor=255,255,255,255
DampedPrimeColor=255,255,255,200
SecondColor=086ca2d0
BGElementColor=255,255,255,64
HighlightColor=086ca2ff

Font=Segoe UI
SmallFont=PF Tempesta Five

RSS1URL="http://www.tagesschau.de/xml/rss2"

RegExpRSS1="(?siU).*<channel>.*<title>(.*)</title>.*<link>(.*)</link>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*</item>"

ToolTipWidth=240

;Measures
;====================================================

[MeasureRSSTitle]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=#RSS1URL#
RegExp=#RegExpRSS1#
UpdateRate=900
StringIndex=1
DecodeCharacterReference=1

[MeasureRSSLink]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=2
DecodeCharacterReference=1

[MeasureRSSItem1Title]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=3
DecodeCharacterReference=1

[MeasureRSSItem1Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=4
DecodeCharacterReference=1

[MeasureRSSItem1Description]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=5
DecodeCharacterReference=1

[MeasureRSSItem2Title]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=6
DecodeCharacterReference=1

[MeasureRSSItem2Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=7
DecodeCharacterReference=1

[MeasureRSSItem2Description]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=8
DecodeCharacterReference=1

[MeasureRSSItem3Title]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=9
DecodeCharacterReference=1

[MeasureRSSItem3Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=10
DecodeCharacterReference=1

[MeasureRSSItem3Description]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=11
DecodeCharacterReference=1

[MeasureRSSItem4Title]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=12
DecodeCharacterReference=1

[MeasureRSSItem4Link]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=13
DecodeCharacterReference=1

[MeasureRSSItem4Description]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureRSSTitle]
StringIndex=14
DecodeCharacterReference=1


;Meters
;====================================================

[Placeholder]
Meter=Image
X=0
Y=0
W=252
H=125
SolidColor=#Transparent#

[Background]
Meter=Image
X=0
Y=0
W=245
H=120
SolidColor=#BackgroundColor#

[MeterRSSTitle]
Meter=String
MeasureName=MeasureRSSTitle
X=6
Y=0
Text=tagesschau
FontFace=#Font#
FontColor=#PrimeColor#
FontSize=20
AntiAlias=1
MouseOverAction= [!SetOption MeterRSSTitle FontColor #HighlightColor#] [!Update]
MouseLeaveAction= [!SetOption MeterRSSTitle FontColor #PrimeColor#] [!Update]
LeftMouseUpAction=["[MeasureRSSLink]"]

[MeterRSSItem1]
Meter=String
MeasureName=MeasureRSSItem1Title
X=10
Y=34
W=225
H=20
ClipString=1
FontFace=#Font#
FontSize=11
FontColor=#PrimeColor#
ToolTipTitle=[MeasureRSSItem1Title]
ToolTipText=[MeasureRSSItem1Description]
ToolTipWidth=#ToolTipWidth#
LeftMouseUpAction=["[MeasureRSSItem1Link]"]
MouseOverAction= [!SetOption MeterRSSItem1 FontColor #HighlightColor#] [!Update]
MouseLeaveAction= [!SetOption MeterRSSItem1 FontColor #PrimeColor#] [!Update]
DynamicVariables=1
AntiAlias=1

[MeterRSSItem2]
Meter=String
MeasureName=MeasureRSSItem2Title
X=10
Y=53
W=225
H=20
ClipString=1
FontFace=#Font#
FontSize=11
FontColor=#PrimeColor#
ToolTipTitle=[MeasureRSSItem2Title]
ToolTipText=[MeasureRSSItem2Description]
ToolTipWidth=#ToolTipWidth#
LeftMouseUpAction=["[MeasureRSSItem2Link]"]
MouseOverAction= [!SetOption MeterRSSItem2 FontColor #HighlightColor#] [!Update]
MouseLeaveAction= [!SetOption MeterRSSItem2 FontColor #PrimeColor#] [!Update]
DynamicVariables=1
AntiAlias=1

[MeterRSSItem3]
Meter=String
MeasureName=MeasureRSSItem3Title
X=10
Y=72
W=225
H=20
ClipString=1
FontFace=#Font#
FontSize=11
FontColor=#PrimeColor#
ToolTipTitle=[MeasureRSSItem3Title]
ToolTipText=[MeasureRSSItem3Description]
ToolTipWidth=#ToolTipWidth#
LeftMouseUpAction=["[MeasureRSSItem3Link]"]
MouseOverAction= [!SetOption MeterRSSItem3 FontColor #HighlightColor#] [!Update]
MouseLeaveAction= [!SetOption MeterRSSItem3 FontColor #PrimeColor#] [!Update]
DynamicVariables=1
AntiAlias=1

[MeterRSSItem4]
Meter=String
MeasureName=MeasureRSSItem4Title
X=10
Y=91
W=225
H=20
ClipString=1
FontFace=#Font#
FontSize=11
FontColor=#PrimeColor#
ToolTipTitle=[MeasureRSSItem4Title]
ToolTipText=[MeasureRSSItem4Description]
ToolTipWidth=#ToolTipWidth#
LeftMouseUpAction=["[MeasureRSSItem4Link]"]
MouseOverAction= [!SetOption MeterRSSItem4 FontColor #HighlightColor#] [!Update]
MouseLeaveAction= [!SetOption MeterRSSItem4 FontColor #PrimeColor#] [!Update]
DynamicVariables=1
AntiAlias=1

Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
vipe7
Posts: 13
Joined: February 14th, 2012, 11:21 pm

Re: Can't figure out the RSS Feed

Post by vipe7 »

MerlinTheRed this is amazing... TKS!!!