It is currently March 29th, 2024, 9:39 am

WebParser Dump Utility

Skins that control functions in Windows or Rainmeter
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

WebParser Dump Utility

Post by eclectic-tech »

When creating and editing skins that use the WebParser Plug-in it is necessary to continually 'hit' the source site to test changes.

This could possibly result in the webmaster action of temporarily BLOCKING your IP address from access. Can you blame them? Your repeated requests appear to them as an attempt to shutdown their site (a common hacker activity!)

Hitting a site repeatedly is not courteous and just a bad idea... :twisted:

WebParser Dump Utility can solve this problem.

It will 'parse' the site using the URL you provide, and save the parsed information in the skin folder as 'WebParserDump.txt' and opens the file in your editor. You can then save it in your skin folder and use it as your target.

You can now use this filename as the URL value URL="file://#CurrentPath#WebParserDump.txt" in your WebParser measure while testing your latest skin, and never worry about being blocked from the information! :)

Also, this dump file is exactly what is returned by the WebParser plug-in, which can be different from the 'View Source', which is browser specific, and may not be what is returned by the plug-in. :sly:

(Utilizes: Debug=2)
You can do this easily in your skin, but new skin authors may not be aware of the feature...

The Code:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Variables]
;Set your weather location code from http://weather.com
WeatherLocationCode=LIS:9
;Set your Yahoo WOEID code from http://yahoo.com
YahooLocation=742676
;Change UnitOfMeasure
; Weather.com:: set to "m" for Centigrade/metric, "f" for Fahrenheit/imperial
; Yahoo.com:: set to "c" for Centigrade/metric, "f" for Fahrenheit/imperial
UnitOfMeasure=f

[MeasureWebParser]
Measure=Plugin
Plugin=WebParser
URL=http://backend.deviantart.com/rss.xml?q=gallery%3Arainmeter%2F23941137&type=deviation&offset=0
RegExp="(?siU)(.*)"
Debug=2
FinishAction=[!HideMeterGroup Search][!ShowMeter Done]
Disabled=1
DynamicVariables=1

[MeterSearchBox]
Meter=Image
W=401
H=26
SolidColor=215,215,215

[MeterSearchLabel]
Meter=String
X=1
Y=3
W=400
H=23
SolidColor=0,0,0,1
FontColor=47,47,47,255
FontFace=Fira Sans
FontSize=12
AntiAlias=1
Text=Enter URL for Dump
LeftMouseUpAction=[!CommandMeasure "MeasureSearchInput" "ExecuteBatch 1"]
Group=Search

[MeasureSearchInput]
Measure=Plugin
Plugin=InputText
X=1
Y=3
W=400
H=23
SolidColor=200,200,200,255
FontColor=47,47,47,255
FontSize=12
AntiAlias=1
FocusDismiss=1
UpdateDivider=-1
Command1=[!SetOption MeasureWebParser "URL" "$UserInput$"][!SetOption MeterSearchLabel Text "... Scanning Site ... "][!UpdateMeter MeterSearchLabel][!Redraw][!EnableMeasure MeasureWebParser][!CommandMeasure MeasureWebParser "Update"]
Group=Search

[Done]
Meter=String
Text="Done! Click to open WebParseDump.txt"
X=1
Y=3
Fontsize=12
StringStyle=Bold
SolidColor=215,215,215
LeftMouseUpAction=["#CURRENTPATH#WebParserDump.txt"][!DeactivateConfig]
Hidden=1

[Metadata]
Name=WebParser Dump Utility
Author=Eclectic Tech
Information=This will download the Rainmeter WebParser plugin's parsed information from any site as a file, in the same folder, named 'WebParserDump.txt'.
The main advantage over 'View Source' is that this file is EXACTLY what the WebParser plug-in 'Sees'. Browser source views can vary by the browser interpretation.
This file can then be used as the URL= in your WebParser measure: 
URL=file://#CurrentPath#WebParserDump.txt 
This is especially helpful when testing new skins and repeated 'hits' to the source website are needed to check changes!!
This will also prevent a 'possible' blocking of your IP for repeated calls to a site while testing skins.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Jan 25, 2015

; ADDENDUM
;
; SAMPLE SITE URLs
;
; Weather.com 6 day forcast (Set your location and unit variables first!)
; http://xml.weather.com/weather/local/#WeatherLocationCode#?cc=*&unit=#UnitOfMeasure#&dayf=6
;
; Yahoo Current Weather (Set your location and unit variables first!)
; http://weather.yahooapis.com/forecastrss?w=#YahooLocation#&u=#UnitOfMeasure#
;
; Rainmeter on DeviantArt 
; http://backend.deviantart.com/rss.xml?q=gallery%3Arainmeter%2F23941137&type=deviation&offset=0
;
; HD Wallpapers
; http://www.hdwallpapers.net/nature-landscapes-wallpapers
;
; Landscape Wallpapers
; http://www.goodfon.su/catalog/landscapes/
Also available as rmskin:
WebParser Dump Utility_1.01.25.2015.rmskin
You do not have the required permissions to view the files attached to this post.