It is currently July 23rd, 2024, 3:53 am

Download=1 and DownloadFile= for WebParser + Quote Plugins

Get help with creating, editing & fixing problems with skins
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by JpsCrazy »

And my hatred for WebParser skins grows...

I'm making a Postsecret.com Quote skin, and I almost have the hang of it?
Right now I'm trying to get all images to download to a folder, "#SkinsPath#\PostSecret\DownloadFile".
Problem is - I can't get ANY image to download to the folder correctly.

For instance, the first image is action.jpg
So I have it set as DownloadFile=action.jpg
The URL is set to the RSS Feed. (http://www.postsecret.com/feeds/posts/default?alt=rss)
I get an image that's action.jpg but it's nothing - just a 23kb image named action.jpg
Changed the url to the regular http://www.postsecret.com/
I get the same thing, but the 'image' is almost double the size.
The actual size is 31kb. (Or 77kb if you get the full sized version from the source.)

So I find the image source, and go to it. (http://2.bp.blogspot.com/_a7jkcMVp5Vg/TBRAe1Zws9I/AAAAAAAAMHE/aDy6yFZNXmE/s1600/action.jpg Careful: NSFW - Language)
Then I plug that in as the url for the WebParser and the DownloadFile=Action.jpg and it works correctly.

Why isn't the first one working?

The code:
[msWebsite]
Measure=Plugin
Plugin=Plugins/WebParser.dll
UpdateRate=7200000
Url=http://www.postsecret.com/feeds/posts/default?alt=rss
Download=1
DownloadFile=action.jpg
Also, is there a way to download ALL images from the website? That's my next task. I was thinking downloadfile=*.jpg (They're all jpgs)
User avatar
jsmorley
Developer
Posts: 22649
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by jsmorley »

If you parse that feed, looking for

catch(e) {}" href="(.*)"&gt so that the urls for the image(s) are stored in StringIndexes, then you can use a webparser measure that refers to that first measure with download=1 and it will get the image for you. It is best to have each webparser measure getting an image use a different name to store it, and don't bother trying to get the actual image name to store it under. It can be done but would be really complicated and pointless. Just DownloadFile=1.jpg, DownloadFile=2.jpg etc. and use those names in the meters so it is "generic" as the website changes and new images are there.

And no, there is no *.jpg in DownloadFile= ;-) WebParser does NOT work that way.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by JpsCrazy »

I still can't manage to get it to work. x.x

Code: Select all

[msImageLink]
Measure=Plugin
Plugin=Plugins/WebParser.dll
UpdateRate=43200000
Url=http://www.postsecret.com/feeds/posts/default?alt=rss
RegExp=catch(e) {}" href="(.*)"&gt
StringIndex=1

[msImageGet]
Measure=Plugin
Plugin=Plugins/WebParser.dll
UpdateRate=43200000
Url=[msImageLink]
Download=1
DownloadFile=1.jpg
Also tried:

Code: Select all

[msImageLink]
Measure=Plugin
Plugin=Plugins/WebParser.dll
UpdateRate=43200000
Url=http://www.postsecret.com/feeds/posts/default?alt=rss
RegExp=catch(e) {}" href="(.*)"&gt
StringIndex=1
Download=1
DownloadFile=1.jpg
What am I doing wrong? :P


That's fine, and actually preferred in this case.
I thought DownloadFile was required to put in the actual file name.
And I didn't think *.jpg would work, but it was worth a try.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by Chewtoy »

RegExp="(?siU)catch(e) {}" href="(.*)"&gt"

Try that RegExp. You forgot (?siU), which is quite very much needed. ;)
I don't think, therefore I'm not.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by JpsCrazy »

Forgot about that x.x

But, *le sigh*, it still doesn't work.

Code: Select all

[Rainmeter]
Author=JpsCrazy
Update=1000

[msImageLink]
Measure=Plugin
Plugin=Plugins/WebParser.dll
UpdateRate=43200000
Url=http://www.postsecret.com/feeds/posts/default?alt=rss
RegExp="(?siU)catch(e) {}\" href=\"(.*)\"&gt"
StringIndex=1
Download=1
DownloadFile=1.jpg

[msGetImage]
Measure=Plugin
Plugin=Plugins/WebParser.dll
UpdateRate=43200000
Url=[msImageLink]
Download=1
DownloadFile=1.jpg

[msSecrets]
Measure=Plugin
Plugin=Plugins/QuotePlugin.dll
PathName=#SkinsPath#\PostSecret\DownloadFile

[mtSlideshow]
Meter=Image
MeasureName=msSecrets
UpdateDivider=8
PreserveAspectRatio=1
Yes. The two first measures are redundant, but at least one should work, right?
Also added \ before " to make sure it didn't end the search there.
User avatar
JamesAC
Developer
Posts: 318
Joined: July 14th, 2009, 5:57 pm

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by JamesAC »

Chewtoy wrote:RegExp="(?siU)catch(e) {}" href="(.*)"&gt"
I think the issue mioght be with the brackets on the e and the curly brackets, as brackets are reserved characters for a regexp they need to be escaped with a leading \. i.e.

Code: Select all

RegExp="(?siU)catch\(e\) \{\}" href="(.*)"&gt"
+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
Quis custodiet ipsos custodes?
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by JpsCrazy »

JamesAC wrote:I think the issue mioght be with the brackets on the e and the curly brackets, as brackets are reserved characters for a regexp they need to be escaped with a leading \. i.e.

Code: Select all

RegExp="(?siU)catch\(e\) \{\}" href="(.*)"&gt"
THANK YOU. THANK YOU. THANK YOU. THANK YOU. THANK YOU.
It works.

And now to finish it up!
I should be finished by tonight,at the very latest end of the week.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by JpsCrazy »

Quick question:
If I do something like:
[msUrl]
webparserblahblahblah
UpdateDivider=36000000

[2]
webparserblahblahblah
url=[msUrl]

Would I need the UpdateDivider for [2] or would that be included with the measure as a variable?
I don't think so, but I don't want to send 26 hits every second to their website. Especially if other people download this skin, that could be bad...



Also: Running into a small problem.
Blank pictures.
Any way I could tell Rainmeter only to download them if over a certain size?
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by poiru »

JpsCrazy wrote:Would I need the UpdateDivider for [2] or would that be included with the measure as a variable?
I don't think so, but I don't want to send 26 hits every second to their website. Especially if other people download this skin, that could be bad...
Nope, you don't need it for [2]. The only measure that connects to the site is [msUrl] :)
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Download=1 and DownloadFile= for WebParser + Quote Plugins

Post by JpsCrazy »

Thanks!

Alright, the second question and a new one is here.

Can I tell Rainmeter to only download files above a certain size?

Also, if I have a generic RegExp and a specific one that overlap in their data would Rainmeter or the RegExp download it twice?

Ex: RegExp:"href=\"(.*)\""
Vs- RegExp:"href=\"(something)\""

So I search the top one say 40 times all with their own string values. And the second search is 38 in that 40. Then I look for that specifically and give it string value of 41. Would Rainmeter/RegExp realize that the second search is already been found?