It is currently May 6th, 2024, 11:00 pm

RSS not displaying correctly

Get help with creating, editing & fixing problems with skins
mckinnon81
Posts: 5
Joined: November 11th, 2010, 3:08 am

RSS not displaying correctly

Post by mckinnon81 »

Hi

I am having some trouble getting a RSS feed to display correctly. I am using a modified RSS config from the HUD.Vision pack.

Here is the config code:

Code: Select all

;===========================================
;  Rainmeter configuration file
;===========================================

[Rainmeter]
Author=Jiri Mahel
AppVersion=1.0
Update=10000
DynamicWindowSize=1

[Variables]
; nastaveni UpdateDivider pri Update=10000 na 15min
update.Spd=90
fontColor.Text=255, 255, 255, 160
bar.color=255, 255, 255, 50
graph.line1=255, 255, 255, 75
graph.line2=255, 255, 255, 37
border.color=255, 255, 255, 75

FontName=Tahoma
FontHeight=8
AntiAlias=1


; click to text open web page in Viewer
vURL=http://www.releaseinfo.net/
eVIEWER=explorer.exe

;RSS url
;URL=http://www.releaseinfo.net/ri/rss.php
URL=http://mmckinnon.homelinux.com/feed.xml


Substitute="&":"&",""":"","&Quot;":"","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":""
;===========================================
;         RSS Reader Display
;===========================================
[RSS]
Measure=Plugin
Debug=1
Plugin=Plugins\WebParser.dll
Url=#URL#
RegExp="(?siU)<title>(.*)</title>.*<item>.*<title>(.*)</title>.*<link>.*</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>.*</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>.*</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>.*</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>.*</link>.*</item>"
UpdateRate=#update.Spd#
StringIndex=1


[mRSS1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=6
Substitute=#Substitute#


[mRSS2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=10
Substitute=#Substitute#

[mRSS3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=14
Substitute=#Substitute#

[mRSS4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=18
Substitute=#Substitute#

[mRSS5]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=22
Substitute=#Substitute#

[mRSS6]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=26
Substitute=#Substitute#

[mRSS7]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=30
Substitute=#Substitute#

[mRSS8]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=34
Substitute=#Substitute#

[mRSS9]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=38
Substitute=#Substitute#

[mRSS10]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=42
Substitute=#Substitute#

;==============================

[button]
Meter=IMAGE
X=4
Y=2
W=10
H=10
SolidColor=#border.color#
LeftMouseDownAction=!execute ["#eVIEWER#" "#vURL#"]

[l.RSS]
Meter=STRING
MeasureName=RSS
X=15
Y=0
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
PreFix="RSS Reader - "
LeftMouseDownAction=!execute ["#eVIEWER#" "#vURL#"]

[cara1]
Meter=IMAGE
X=0
Y=19r
W=300
H=1
SolidColor=#border.color#

[l.RSS1]
Meter=STRING
MeasureName=mRSS1
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara2]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS2]
Meter=STRING
MeasureName=mRSS2
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara3]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS3]
Meter=STRING
MeasureName=mRSS3
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara4]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS4]
Meter=STRING
MeasureName=mRSS4
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara5]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS5]
Meter=STRING
MeasureName=mRSS5
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara6]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS6]
Meter=STRING
MeasureName=mRSS6
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara7]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS7]
Meter=STRING
MeasureName=mRSS7
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara8]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS8]
Meter=STRING
MeasureName=mRSS8
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara9]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS9]
Meter=STRING
MeasureName=mRSS9
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara10]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS10]
Meter=STRING
MeasureName=mRSS10
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1

[cara11]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#
The only things I have changed are the URL for the feed and the RegExp to try and get it to display. With debugging turned on I can see that it finds Index 1 to 6. If i add any more .*<item>.*<title>(.*)</title>.*<link>.*</link>.*</item> to the end of the current RegExp the debug log will return an error - Matching error! (-1)

With the current config It will display the Name of the RSS and one entry that is half way down the list. I know I am close at getting this to work.

You can see the rss at http://mmckinnon.homelinux.com/feed.xml

Code is:

Code: Select all

<?xml version="1.0"?>
<rss version="2.0">
<channel><title>Linux ISOs</title>
<item>
<title>debian-506-i386-netinst.iso</title>
<link>http://192.168.0.2/torrents/ISO/debian-506-i386-netinst.iso</link></item>
<item>
<title>ubuntu-10.10-desktop-amd64.iso</title>
<link>http://192.168.0.2/torrents/ISO/ubuntu-10.10-desktop-amd64.iso</link></item>
<item>
<title>ipcop-1.4.20-install-cd.i386.iso</title>

<link>http://192.168.0.2/torrents/ISO/ipcop-1.4.20-install-cd.i386.iso</link></item>
<item>
<title>archlinux-2010.05-core-dual.iso</title>
<link>http://192.168.0.2/torrents/ISO/archlinux-2010.05-core-dual.iso</link></item>
<item>
<title>debian-504-i386-netinst.iso</title>
<link>http://192.168.0.2/torrents/ISO/debian-504-i386-netinst.iso</link></item>
</channel></rss>
This is created from a very rough python script to watch a folder for changes and create the corresponding xml file :)

Any help on getting this to work is appreciated.

Thanks
Matthew
mckinnon81
Posts: 5
Joined: November 11th, 2010, 3:08 am

Re: RSS not displaying correctly

Post by mckinnon81 »

Thanks too jsmorley and chewtoy on IRC I was able to get some advice and get this solved

For those interested here is the chat log if you need help as well :)

Code: Select all

»» Now talking on #rainmeter
»» Topic for #rainmeter is: Welcome to the Rainmeter IRC. All questions, comments, and concepts are welcome here. The Rainmeter forum can be found at: http://forum.rainmeter.net/ $$ Rainmeter 1.3 is now availabe from http://www.rainmeter.net/
»» Topic for #rainmeter set by jsmorley!~Jeffrey@ip24-255-123-182.dc.dc.cox.net at Mon Oct 18 05:26:37 2010
<Thraul> Hi
<Chewtoy> Hi.
<@poiru> Hi..
<Thraul> i am having some trouble gettng a rss config to display correctly the rainmeter debug log says index 1 to 6 it has found but the config will only display the title and one entry...this is a custom rss too that i have created if that make a differance
<@jsmorley> Hi...
<Thraul> you can see the rss at http://mmckinnon.homelinux.com/feed.xml
<@jsmorley> If you post your code in the forums in Rainmeter Help, someone can look at it and help you.
<Thraul> ok then thanks will post there now....
<@jsmorley> Cool.
<@jsmorley> I'll look at it in a bit and see what I can noodle out.
<Chewtoy> Noodle, not noodle~
<Thraul> ok thanks message posted. If you need more info just let me know :D
<@jsmorley> I get six items, "Linux ISOs and then five distro's. Right?
<Thraul> yes
<@jsmorley> Ok. let me dig a bit deeper.
<Thraul> i have set that up as a test to try and get it to work...list could be bigger or smaller depeding on what linux iso's i have downloaded...
<@jsmorley> Your StringIndexes are wrong
<@jsmorley> It should just be StringIndex=1 to StringIndex=6
<@jsmorley> So [mRSS1] should have StringIndex=1 and so on, to StringIndex=6
<@jsmorley> It looks like this was originally intended to provide two returns per "title", one for the title and one for a link or something. But your RegExp is just returning one overall title and five entries with no links.
<Thraul> eventually I want the link to be found as well so if i clink on it will download the link...
<@jsmorley> Then you have some more work to do on the RegExp.
<Thraul> if i change the regexp to have 7 entries i get a matching error in the debug..if i take it back to 6 it works....
<@jsmorley> Remember that (.*) returns the found data in a StringIndex, and .* "skips" data.
<@jsmorley> You are currently "skipping" all the links.
<@jsmorley> <title>(.*)</title>.*<link>.*</link>
<@jsmorley> If you made this <title>(.*)</title>.*<link>(.*)</link> you would get both, and twice as many StringIndexes.
<Thraul> ok then let me try it..
<Chewtoy> If the number of items varies I would recommend using 'look ahead' regexp. Or else everything will fail when there are less items then the code is intended for.
<@jsmorley> Are you using RainRegExp?
<@jsmorley> Yeah, that too, although I tend to get the core search working first, so I am sure I understand the pattern, before I try to add the look ahead stuff.
<Thraul> i dont think so...this i my first attempt at rainmeter and changing a config....
<Thraul> ok now it displays the title and link....which is good...
<Thraul> more modify needed...would like the link to be hidden and be able to click on the title and take me to its link :D
<@jsmorley> RainRegExp can make writing those RegExp statements a bit easier.  http://rainmeter.net/forum/viewtopic.php?p=5635#p5635
<@jsmorley> Yeah, instead of displaying the link in a meter, just add the link to a LeftMouseUpAction= to the meter displaying the title.
<@jsmorley> like LefMouseUpAction=!Execute ["[mRSS1]"]
<@jsmorley> If mRSS1 is returning a link, that will fire it in your browser.
<@jsmorley> Just a nitpick, but he has the main [RSS] measure being returned into StringIndex=1, which is not needed, and then makes you have to push all the one after so that the first entry is 2 and the second 3 etc.  I would be tempted to do away with that so that entry 1 is StringIndex 1 etc.  Just easier to follow.
<Thraul> ok thanks will change that
<@jsmorley> Let me know if you get stuck.  Sounds to me like you have a good head on your shoulders, and I don't doubt you will figure it out from here, which is the best way to learn.
<Thraul> with removing stingindex=1 from [RSS] and making [mRSS1] stringindex=1 i now get <title> displayed though out and text ontop of each other....
<@jsmorley> With this RegExp:
<@jsmorley> (?siU)<title>(.*)</title>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>
<@jsmorley> I get:
<@jsmorley> 01=> Linux ISOs
<@jsmorley> 02=> debian-506-i386-netinst.iso
<@jsmorley> 03=> http://192.168.0.2/torrents/ISO/debian-506-i386-netinst.iso
<@jsmorley> 04=> ubuntu-10.10-desktop-amd64.iso
<@jsmorley> 05=> http://192.168.0.2/torrents/ISO/ubuntu-10.10-desktop-amd64.iso
<@jsmorley> 06=> ipcop-1.4.20-install-cd.i386.iso
<@jsmorley> 07=> http://192.168.0.2/torrents/ISO/ipcop-1.4.20-install-cd.i386.iso
<@jsmorley> 08=> archlinux-2010.05-core-dual.iso
<@jsmorley> 09=> http://192.168.0.2/torrents/ISO/archlinux-2010.05-core-dual.iso
<@jsmorley> 10=> debian-504-i386-netinst.iso
<@jsmorley> 11=> http://192.168.0.2/torrents/ISO/debian-504-i386-netinst.iso
<@jsmorley> as the returned StringIndexes.
<@jsmorley> So you need to then set the measures to use those StringIndexs, and you should be able to wrangle it any way you want in meters.
<Thraul> ok string indexs are now being returned...is there a way to hide the links..so that when i click on one of the titles in the rssit will take me to that link...if i clink on arch entry it will take me to the arch link..if i clunk on ubunu it will take me to the ubuntu link...
<@jsmorley> Just get rid of the meters showing the links, leave the ones showing the titles. You will progably have to mess with X and Y on the remaining meters for layout.
<Thraul> really only need the titles displayed...
<@jsmorley> Then add that LeftMouseUpAction= line I mentioned above to each of the meters showing the titles.
<@jsmorley> With the LeftMouseUpAction using the measures returning the links.
<@jsmorley> Then the link won't show, only the titles, but when you click on a title the link will be launched.
<@jsmorley> You ok with that in principle, or should I put an example in the forums?
<Thraul> that sounds ok i am not just trying to remove the links being displyed from the config....
<@jsmorley> I'm not sure I follow that.
<Thraul> i am removing the tags in the configs that display the links on screen but still have them marked so i can use them when i clink on a title
<Thraul> ok what i did was remove all the areas that where marked [1.RSS2] (all the even numbers) and the same with [carra2] (all the even numbers) and now I have just the titles displayed on screen...
<@jsmorley> Excellent
<@jsmorley> So now just add those LeftMouseUpAction lines to each, with LeftMouseUpAction=!Execute ["[MeasureName]"] pointing to the alternate measure that you are not displaying, which contain the links.
<Thraul> ok so now i put LefMouseUpAction=!Execute ["[mRSS1]"] in the [1.RSS1] area it should allow me to click on the title and take me to that link?
<@jsmorley> Assuming that [mRRS1] is returning the link for that entry, and not the title.
<@jsmorley> You should still have 12 measures, but only 6 meters.
<@jsmorley> If you see what I mean.
<@jsmorley> Measures with these values: ftp://jsmorley.serveftp.com/test.png
<Thraul> ok 02=> is [mRSS1] which = [1.RSS1] which is the display under here i have entered LefMouseDownAction=!Execute ["[mRSS2]"] refreshed the config but does not seam to be working.
<@jsmorley> If you use "About" in the context menu, what is mRSS2 returning?
<@jsmorley> Also, you misspelled "Left" at least in IRC.
<Thraul> mrSS2 is returning the link
<Thraul> brilliant thats working...champions for your help :D
<@jsmorley> No sweat.  Another nit.  I would use LeftMouseUpAction not LeftMouseDownAction.
<Thraul> now what about allowing it to have more items it the regexp than what is in the xml ?
<Thraul> y leftmouseup?
<@jsmorley> The result is the same, but you then are able to drag the skin by clicking and dragging on the meter. With "Down" you can't
<Chewtoy> Else you can't drag it.
<@jsmorley> LeftMouseDownAction is virtually useless in my opinion.
<Thraul> because this xml list can grow or be smaller than what is in the reg exp how do i allow it to work with out failing
<Chewtoy> Thraul: http://rainmeter.net/cms/Tips-GoogleReaderRSS <-- Have a look at that.
<Chewtoy> Thraul: Mostly focus on how the regexp is built.
<@jsmorley> I'm not the best at doing "look ahead / around" regular expressions.  Maybe post again in that thread and ask that specific question and Chewy or poiru or someone can help with that.
<@jsmorley> I can do it, but it would take me 1/2 hour of trial and error and someone else can probably just spit it out.
<Chewtoy> (?(?=.*IfThis).*GethThis)
<Thraul> is there somewhere were I can look at examples and help with the "look ahead / around" regular expressions?
<Chewtoy> Is pretty much how it works, as far as I have understood it.
<Chewtoy> http://www.regular-expressions.info/
<@jsmorley> http://www.regular-expressions.info/lookaround.html
<Chewtoy> I'm not sure how you've changed your regexp now, so I can't really give any help of how to rewrite it.
<Thraul> its still the same as what was posted earlier in the log - (?siU)<title>(.*)</title>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>.*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*</item>
<Chewtoy> Right.
<Chewtoy> So, something like... I dunno... (?(?=.*<item>).*<title>(.*)</title>.*<link>(.*)</link></item>)
<Chewtoy> Something like that.
<Chewtoy> No.
<@jsmorley> That doesn't look right
<Chewtoy> So, something like... I dunno... (?(?=.*<item>).*<title>(.*)</title>.*<link>(.*)</link>.*</item>)
<Chewtoy> That better.
<Chewtoy> +s
<@jsmorley> You will need the look ahead assertion on each "item"
<@jsmorley> Ah, that is where you are going.
<Thraul> using (?siU)<title>(.*)</title>(?(?=.*<item>).*<title>(.*)</title>.*<link>(.*)</link>.*</item>) in the rainregexp it returns 01 to 09 not 11 it stops :)
<Thraul> :(
<Chewtoy> The thing I posted is for ONE item. You'll have to add it for as many items you want returned.
<Chewtoy> Recomended is to make it a variable then just use that variable over and over.
<Chewtoy> RainRegExp will go on for ever pretty much. Rainmeter wont.
---» Alex2539 (~Alex2539@modemcable187.71-201-24.mc.videotron.ca) has Joined #rainmeter
»» ChanServ gives channel operator status to Alex2539
<Chewtoy> Thraul: Getting it to work?
<Thraul> ok i have made a variable REGXP = (?(?=.*<item>).*<title>(.*)</title>.*<link>(.*)</link>.*</item>)
<Thraul> and then done this RegExp="(?siU)<title>(.*)</title>#REGXP##REGXP##REGXP##REGXP##REGXP##REGXP##REGXP##REGXP##REGXP##REGXP#"
<Thraul> it is still displaying the feed :) now need to add a few more lines to the feed for more entries if the happen and also add all the leftmouseupactions :D
<Chewtoy> Goodie. :)
<Thraul> thanks for your helped has helped me unterstand a bit more...a lot better then trying to read and trying to do it :D
<@jsmorley> Good deal.
<Chewtoy> Yeah. I know how it is.
<Chewtoy> Trying to learn C++. It's hell just reading 'It is like this.' and then have no idea of how you use it...
<Thraul> and with this being my first config attempt...i have jumped in the deep end a bit...
<@jsmorley> Yes, you did.
<@jsmorley> ;-)
<@jsmorley> You might want to add a reply to your post saying it was solved in IRC so folks don't jump on it.
<Thraul> yeah i will thanks
mckinnon81
Posts: 5
Joined: November 11th, 2010, 3:08 am

Re: RSS not displaying correctly

Post by mckinnon81 »

Here is the updated and working config if people need it:

Code: Select all

;===========================================
;  Rainmeter configuration file
;===========================================

[Rainmeter]
Author=Jiri Mahel Changes made by Matt McKinnon
AppVersion=1.0
Update=10000
DynamicWindowSize=1

[Variables]
; nastaveni UpdateDivider pri Update=10000 na 15min
update.Spd=90
fontColor.Text=255, 255, 255, 160
bar.color=255, 255, 255, 50
graph.line1=255, 255, 255, 75
graph.line2=255, 255, 255, 37
border.color=255, 255, 255, 75

FontName=Tahoma
FontHeight=8
AntiAlias=1


; click to text open web page in Viewer
vURL=http://www.releaseinfo.net/
eVIEWER=explorer.exe

;RSS url
;URL=http://www.releaseinfo.net/ri/rss.php
URL=http://mmckinnon.homelinux.com/feed.xml

REGXP = (?(?=.*<item>).*<title>(.*)</title>.*<link>(.*)</link>.*</item>)

Substitute="&":"&",""":"","&Quot;":"","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":""
;===========================================
;         RSS Reader Display
;===========================================
[RSS]
Measure=Plugin
Debug=1
Plugin=Plugins\WebParser.dll
Url=#URL#
RegExp="(?siU)<title>(.*)</title>#REGXP##REGXP##REGXP##REGXP##REGXP##REGXP##REGXP##REGXP##REGXP##REGXP#"
UpdateRate=#update.Spd#
StringIndex=1


[mRSS1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=2
Substitute=#Substitute#

[mRSS2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=3
Substitute=#Substitute#

[mRSS3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=4
Substitute=#Substitute#

[mRSS4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=5
Substitute=#Substitute#

[mRSS5]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=6
Substitute=#Substitute#

[mRSS6]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=7
Substitute=#Substitute#

[mRSS7]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=8
Substitute=#Substitute#

[mRSS8]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=9
Substitute=#Substitute#

[mRSS9]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=10
Substitute=#Substitute#

[mRSS10]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=11
Substitute=#Substitute#

[mRSS11]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=12
Substitute=#Substitute#

[mRSS12]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=13
Substitute=#Substitute#

[mRSS13]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=14
Substitute=#Substitute#

[mRSS14]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=15
Substitute=#Substitute#

[mRSS15]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=16
Substitute=#Substitute#

[mRSS16]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=17
Substitute=#Substitute#

[mRSS17]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=18
Substitute=#Substitute#

[mRSS18]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=19
Substitute=#Substitute#

[mRSS19]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=20
Substitute=#Substitute#

[mRSS20]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[RSS]
StringIndex=21
Substitute=#Substitute#



;==============================

[button]
Meter=IMAGE
X=4
Y=2
W=10
H=10
SolidColor=#border.color#
LeftMouseUpAction=!execute ["#eVIEWER#" "#vURL#"]

[l.RSS]
Meter=STRING
MeasureName=RSS
X=15
Y=0
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
PreFix="RSS Reader - "
LeftMouseUpAction=!execute ["#eVIEWER#" "#vURL#"]

[cara1]
Meter=IMAGE
X=0
Y=19r
W=300
H=1
SolidColor=#border.color#

[l.RSS1]
Meter=STRING
MeasureName=mRSS1
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS2]"]

[cara3]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS3]
Meter=STRING
MeasureName=mRSS3
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS4]"]


[cara5]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS5]
Meter=STRING
MeasureName=mRSS5
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS6]"]

[cara7]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS7]
Meter=STRING
MeasureName=mRSS7
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS8]"]

[cara9]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS9]
Meter=STRING
MeasureName=mRSS9
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS10]"]


[cara11]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS11]
Meter=STRING
MeasureName=mRSS11
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS12]"]


[cara13]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS13]
Meter=STRING
MeasureName=mRSS13
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS14]"]


[cara15]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS15]
Meter=STRING
MeasureName=mRSS15
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS16]"]


[cara17]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS17]
Meter=STRING
MeasureName=mRSS17
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS18]"]


[cara19]
Meter=IMAGE
X=0
Y=17r
W=300
H=1
SolidColor=#border.color#

[l.RSS19]
Meter=STRING
MeasureName=mRSS19
X=2
Y=1r
StringStyle=NORMAL
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
LeftMouseUpAction=!Execute ["[mRSS20]"]


dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: RSS not displaying correctly

Post by dragonmage »

You could consider sharing the python script as well in case someone wants to use it ;)
mckinnon81
Posts: 5
Joined: November 11th, 2010, 3:08 am

Re: RSS not displaying correctly

Post by mckinnon81 »

Here is the python script. It is very rough as I do not know python, but hey it works!!

Code: Select all

import os
path="/home/moe/torrents/completed/"  # insert the path to the directory of interest here
dirList=os.listdir(path)
f = open ('/var/www/completeddownloads.xml','w') #Path to file to create

f.write('<?xml version=\"1.0\"?>\n')
f.write('<rss version=\"2.0\">\n')
f.write('<channel>')
f.write('<title>Completed Downloads</title>\n')
for fname in dirList:
    f.write('<item>\n')
    f.write('<title>')
    f.write(fname)
    f.write('</title>\n')

    f.write('<link>http://192.168.0.2/torrents/completed/') #virtal link in web directory to above path to watch
    f.write(fname)
    f.write('</link>')

    f.write('</item>\n')


f.write('</channel></rss>')

f.close()
mckinnon81
Posts: 5
Joined: November 11th, 2010, 3:08 am

Re: RSS not displaying correctly

Post by mckinnon81 »

I decided to move from python to a perl script. Reason is I can sort the list via time created. So that the most recent folder/file created will appear at the top of the list

Code: Select all

#!/usr/bin/perl

$dirtoget="/home/moe/torrents/completed";
opendir(IMD, $dirtoget) || die("Cannot open directory");
@thefiles= readdir(IMD);
closedir(IMD);

@thefiles = sort { -M "$dirtoget/$a" <=> -M "$dirtoget/$b" } (@thefiles);

print "<?xml version=\"1.0\"?>\n";
print "<rss version=\"2.0\">\n";
print "<channel>\n";
print "<title>Completed Downloads</title>\n";

foreach $f (@thefiles)
{
 unless ( ($f eq ".") || ($f eq "..") )
 {
  print "<item>\n";
  print "<title>";
  print "$f";
  print "</title>\n";
  print "<link>";
  print "http://192.168.0.2/torrents/completed/$f";
  print "</link>\n";
  print "</item>\n";
 }
}
print "</channel></rss>\n";
I then have a cron job running to perl <perl script> >> /var/www/<xml filename>

Then open browser to test http://<webserver>/<xml filename>
Will then open the RSS. Then use the above RSS Code feed to read it :D

Any comments or updates appreciated.