It is currently April 28th, 2024, 4:08 pm
Parse Feedburner?
-
- Posts: 98
- Joined: August 1st, 2012, 12:48 am
Parse Feedburner?
Would it be possible to create a feed in rainmeter from something like this: http://feeds.feedburner.com/WhatsNewOnNetflix?format=xml I was attempting it but it wasn't working for me. I don't know a whole heck of a lot about parsing though.
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Parse Feedburner?
It looks like a standard RSS feed, so it shouldn't give you any unexpected trouble. There's a script that you can use as a universal feed reader (although I need to update it soon, it should still work for you). Or, if you'd rather try your own non-Lua solution, there's a WebParser tutorial here, as well as any number of feed skins that you can reverse-engineer. Parsing feeds is a pretty common task, so there's no need to reinvent the wheel.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Parse Feedburner?
Sure. You can tear apart just about any RSS skin to get a sense of how it works to use WebParser to parse an XML/Atom feed like that.
The long and the short of it is that you will create a "parent" WebParser measure with the URL on it, and a RegExp= that parses the site into as many StringIndex (captures) as you want. Then you use a series of "child" WebParser measures to pick off each StringIndex one at a time by using URL=[ParentMeasureName] and StringIndex=X (where X is the StringIndex number from the parent measure you want to get into the child measure.
Then you just build meters that use those child measures as the MeasureName= option on them, and you are done.
The most complicated bit when you are new at it is the RegExp= to parse the site into StringIndexes. What I would suggest there is to get RainRegExp which can be a lot of help in getting that part working.
Take an initial run at it after looking at a skin or two from deviantART that read RSS feeds, and if you are still stuck, we can take it to the next level here.
The long and the short of it is that you will create a "parent" WebParser measure with the URL on it, and a RegExp= that parses the site into as many StringIndex (captures) as you want. Then you use a series of "child" WebParser measures to pick off each StringIndex one at a time by using URL=[ParentMeasureName] and StringIndex=X (where X is the StringIndex number from the parent measure you want to get into the child measure.
Then you just build meters that use those child measures as the MeasureName= option on them, and you are done.
The most complicated bit when you are new at it is the RegExp= to parse the site into StringIndexes. What I would suggest there is to get RainRegExp which can be a lot of help in getting that part working.
Take an initial run at it after looking at a skin or two from deviantART that read RSS feeds, and if you are still stuck, we can take it to the next level here.
-
- Posts: 98
- Joined: August 1st, 2012, 12:48 am
Re: Parse Feedburner?
Thanks guys.
-
- Posts: 98
- Joined: August 1st, 2012, 12:48 am
Re: Parse Feedburner?
Alright need some help here. In the tool you provided I can successfully parse the lines I want and have them returned as string indexes. When I try to put them into rainmeter nothing shows up. I probably mistyped something or something along those lines but I can't figure it out.
Code: Select all
[mFeed]
Measure=Plugin
Plugin=WebParser
Url=http://feeds.feedburner.com/WhatsNewOnNetflix?fmt=xml
RegExp="(?siU)<item>.*<description><p><strong>(.*)<.*img src="(.*)".*/></a><br />(.*)<.*a href=.*a href="(.*)".*</description>"
StringIndex=1
[mCoverArt]
Measure=Plugin
Plugin=WebParser
Url=[mFeed]
StringIndex=2
[mDescription]
Measure=Plugin
Plugin=WebParser
Url=[mFeed]
StringIndex=3
;==========================================================================
[Title]
Meter=String
MeasureName=mFeed
FontSize=100
FontColor=FFFFFF
X=0
Y=0
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Parse Feedburner?
You didn't do anything wrong. You just need to add:
(The [Title] meter technically has zero width and height when the skin is loaded. And without DWS=1, the skin never expands to fit the new text.)
Code: Select all
[Rainmeter]
DynamicWindowSize=1
-
- Posts: 98
- Joined: August 1st, 2012, 12:48 am
Re: Parse Feedburner?
Thanks.
-
- Posts: 98
- Joined: August 1st, 2012, 12:48 am
Re: Parse Feedburner?
One more quick question. How can I take a link to a image and have that image display in a meter?
Example I want: http://cdn-0.nflximg.com/en_CA/boxshots/ghd/70202129.jpg
To show the actual image on my desktop. I tried meter=image but that didn't display anything.
EDIT: I figured it out. I had to place Download=1 in my measure.
Example I want: http://cdn-0.nflximg.com/en_CA/boxshots/ghd/70202129.jpg
To show the actual image on my desktop. I tried meter=image but that didn't display anything.
EDIT: I figured it out. I had to place Download=1 in my measure.
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Parse Feedburner?
Set the WebParser URL to the image address, then add Download=1. The measure will return a path to the downloaded image's location (usually in your Temp directory, unless you choose another location).
EDIT: Ah, good good. :)
EDIT: Ah, good good. :)
-
- Posts: 98
- Joined: August 1st, 2012, 12:48 am
Re: Parse Feedburner?
Another problem. Netflix has 5 link types for its covers. boxshots/tiny, boxshots/small, boxshots/large, boxshots/ghd and boxshots/ghd_ste. The link type that my feed returns is small. I want to substitute it to ghd so it will download the HD cover instead.
First I tried add substitute="small":"ghd" to my measure that returns the string where the image is. That worked but when I set it to download the image it downloaded the small one and not the large one. So I figured I'd try it in the measure where my RegExp is and that didn't even change the string. It remained small. Any ideas on how I can accomplish this?
I want http://cdn-0.nflximg.com/en_CA/boxshots/small/70202129.jpg to be http://cdn-0.nflximg.com/en_CA/boxshots/ghd/70202129.jpg
First I tried add substitute="small":"ghd" to my measure that returns the string where the image is. That worked but when I set it to download the image it downloaded the small one and not the large one. So I figured I'd try it in the measure where my RegExp is and that didn't even change the string. It remained small. Any ideas on how I can accomplish this?
I want http://cdn-0.nflximg.com/en_CA/boxshots/small/70202129.jpg to be http://cdn-0.nflximg.com/en_CA/boxshots/ghd/70202129.jpg