It is currently April 19th, 2024, 1:29 am

Help: make RSS Reader only refresh when online

Get help with creating, editing & fixing problems with skins
User avatar
ruki
Posts: 6
Joined: May 29th, 2009, 10:14 am
Location: Indonesia

Help: make RSS Reader only refresh when online

Post by ruki »

I want to customize my RSS Reader, so that it only refresh when my PC goes online. Otherwise, if my PC goes offline, it will display the content from the last connection.

Is it possible to save latest RSS value (since it is dynamic) to a local file that will be remaining even after I reboot my PC? I think it will be great since if I restart my computer without any internet connection, this RSS reader will not be empty (displaying the latest value).
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Help: make RSS Reader only refresh when online

Post by Chewtoy »

http://rainmeter.net/cms/Plugins-WebParser

You could probably download the feeds to a local file and then parse that file.
You would however have to find someway so it will delete the old feeds when it is time to refresh.
I don't think, therefore I'm not.
User avatar
ruki
Posts: 6
Joined: May 29th, 2009, 10:14 am
Location: Indonesia

Re: Help: make RSS Reader only refresh when online

Post by ruki »

how could I download the feeds to a local file?
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: Help: make RSS Reader only refresh when online

Post by kenz0 »

This is the simple example.

Code: Select all

[DownloadSource]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=http://rainmeter.net/forum/rss.php?f=5
Download=1
DownloadFile=Source.txt

[ParseSource]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=5
Url="file://#CURRENTPATH#DownloadFile\Source.txt"
RegExp="(?sU)<item>.*<title>(.*)<"
StringIndex=1
Note:
"Source.txt" would be always downloaded every 3600 seconds. And [ParseSource] is always parsing "Source.txt".
When after restart, if the Internet has not been connected, existing "Source.txt" should be parsed.
Then after next 3600 seconds, if the connection is established, "Source.txt" would be overwritten by the latest one.
.
Image
User avatar
ruki
Posts: 6
Joined: May 29th, 2009, 10:14 am
Location: Indonesia

Re: Help: make RSS Reader only refresh when online

Post by ruki »

I just know this from here. I'll try it later (I'm in the middle of some work now).
Thank you! :thumbsu:
User avatar
ruki
Posts: 6
Joined: May 29th, 2009, 10:14 am
Location: Indonesia

Re: Help: make RSS Reader only refresh when online

Post by ruki »

I've tried your code, but it doesn't work. The "this.txt" doesn't contain anything and the "Item1" doesn't show anything. Can you help me?

Code: Select all

[DownloadSource]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=http://rainmeter.net/forum/rss.php?f=5
Download=1
DownloadFile=D:\this.txt

[ParseSource]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=5
Url="file:D:\this.txt"
RegExp="(?sU)<item>.*<title>(.*)<"
StringIndex=1

[Item1]
Meter=STRING
MeasureName=ParseSource
X=10
Y=10
Prefix="Value: "
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: Help: make RSS Reader only refresh when online

Post by kenz0 »

ruki wrote:[DownloadSource]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=http://rainmeter.net/forum/rss.php?f=5
Download=1
DownloadFile=D:\this.txt

[ParseSource]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=5
Url="file:D:\this.txt"
RegExp="(?sU)<item>.*<title>(.*)<"
StringIndex=1
It has the feature which downloads a file to "DownloadFile" folder in a current skin, and it isn't possible to define a download directory by an absolute path.
You only need to define filename for download file.

DownloadFile=this.txt

this.txt would be downloaded to "DownloadFile" folder in a current skin.
then, you have to define correct path of the downloaded file to parse it.

Url="file://#CURRENTPATH#DownloadFile\this.txt"

(Note that it is not possible to download to outside of current skin folder with DownloadFile.)
.
Image
User avatar
ruki
Posts: 6
Joined: May 29th, 2009, 10:14 am
Location: Indonesia

Re: Help: make RSS Reader only refresh when online

Post by ruki »

Huaa.. I can't make it! :roll:

Is there any skin that using this method?
I would like to see and try to modify my own skin from it..
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: Help: make RSS Reader only refresh when online

Post by kenz0 »

You can use as actual skin by adding proper meter to first example code.

Code: Select all

[DownloadSource]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=http://rainmeter.net/forum/rss.php?f=5
Download=1
DownloadFile=Source.txt

[ParseSource]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=5
Url="file://#CURRENTPATH#DownloadFile\Source.txt"
RegExp="(?sU)<item>.*<title>(.*)<"
StringIndex=1

[Item1]
Meter=STRING
MeasureName=ParseSource
SolidColor=FFFFFF
W=200
H=32
ClipString=1
You should try and see result without any modification first.
.
Image