It is currently April 27th, 2024, 5:29 pm

RSS Feed Status Meter

Get help with creating, editing & fixing problems with skins
User avatar
Dany Gee
Posts: 33
Joined: July 11th, 2012, 8:32 am

RSS Feed Status Meter

Post by Dany Gee »

Hi Everyone!

Problem Scenario:
In my work I have a Rainmeter skin, where there is a Facebook RSS Feed meter (exact the same as in Gnometer) that shows the 2 latest notifications for my account. I'am connected to the Internet via Proxy. Offcourse proxy does not allow us to connect to Facebook, so the skin shows nothing (by direct connection at home shows everything OK). I would really like the skin to show a message "Not available" in case it cannot retrieve the RSS Feed (or there is no connection at all).

How can it be done?

I get the general idea, most probably it can be achieved by something similar to this:
(Here the skins shows N/A where there is no WiFi connection)

Code: Select all

[mStrength]
Measure=Plugin
Plugin=WifiStatus.dll
WifiInfoType=QUALITY
WifiIntfID=0
IfEqualValue=0
IfEqualAction=!execute [!RainmeterSetVariable Text "N/A"]
IfAboveValue=0
IfAboveAction=!execute [!RainmeterSetVariable Text "%1"]
UpdateDivider=5
But the question is: Is something like that possible for RSS Feeds?

The FB ini :

Code: Select all

[Variables]
feeds.facebook=http://MY FB RSS URL
GET=(?(?=.*<item>).*<item>.*<title>(.*)</.*<link>(.*)</)
SubstituteFeed="&apos;":"'",""":"","&Quot;":"","&":"&","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'","&#228;":"?"&#246;":"??&#8211;":"?,"'":"'"
SubstituteLink="&":"&","<![CDATA[":"","]]>":""

[mFacebook]
Measure=Plugin
Plugin=WebParser.dll
Url=#feeds.Facebook#
RegExp="(?siU)#GET##GET#"
UpdateRate=60

[mItem1]
Measure=Plugin
Plugin=WebParser.dll
Url=[mFacebook]
DecodeCharacterReference=1
StringIndex=1
Substitute=#SubstituteFeed#

[mLink1]
Measure=Plugin
Plugin=WebParser.dll
Url=[mFacebook]
StringIndex=2
;Substitute=#SubstituteLink#

[mItem2]
Measure=Plugin
Plugin=WebParser.dll
Url=[mFacebook]
DecodeCharacterReference=1
StringIndex=3
Substitute=#SubstituteFeed#

[mLink2]
Measure=Plugin
Plugin=WebParser.dll
Url=[mFacebook]
StringIndex=4
Substitute=#SubstituteLink#

; METERS ======================================

[meterSeperator3]
Meter=IMAGE
MeterStyle=styleSeperator
X=0
Y=12
W=180
H=3

[Subtitle]
Meter=STRING
x=5
Y=0
W=100
H=20
MeterStyle=styleLeftTextBold
AntiAlias=1
LeftMouseUpAction=!Execute [www.facebook.com]
RightMouseDownAction=!Execute [!RainmeterRefresh]
ToolTipText="Open www.facebook.com (right-click to refresh)"
MouseActionCursor=1
Text="Facebook:"

[Item1.>]
Meter=STRING
MeterStyle=styleLeftText
X=5
Y=20
Text=>

[Item1]
Meter=STRING
MeterStyle=styleLeftText
MeasureName=mItem1
;LeftMouseUpAction=!Execute ["[mLink1]"]
X=10
Y=20
W=165
H=20
FontColor=#FontColor#
AntiAlias=1

[Item2.>]
Meter=STRING
MeterStyle=styleLeftText
X=5
Y=40
Text=>

[Item2]
Meter=STRING
MeterStyle=styleLeftText
MeasureName=mItem2
;LeftMouseUpAction=!Execute ["[mLink2]"]
X=10
Y=40
W=165
H=20
FontColor=#FontColor#
AntiAlias=1
Any help highly appreciated!
SYSTEM: Windows 11 Pro 64bit|MOBO: ASUS Z170 Deluxe|CPU: i7-6700K @ 4.3Ghz|GPU: Asus GTX1080 Strix|RAM: 64GB Gskill Trident Z RGB (2400Mhz CL15)
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: RSS Feed Status Meter

Post by MerlinTheRed »

To my knowledge WebParser does not return any error if it can't connect to the internet. It just acts as if it was parsing an empty string. I suppose you could use this and put some message if WebParser returns empty strings.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!