It is currently April 8th, 2020, 1:59 pm

Creating a skin that displays text from a reference manual

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Creating a skin that displays text from a reference manual

Post by Yincognito »

eclectic-tech wrote:
March 21st, 2020, 2:46 pm
I too had the same results with the first code... the one supplied by Yincognito works, in fact it works on other sites too!
Yeah, I like things to work for everything you throw at them (remember, I'm in the "it IS possible" camp, not the K.I.S.S. one, LOL) - but the only thing that should still be done (I didn't, because I was looking for a quick solution at the time) is to cover the (remote, but still a) possibility that there could be less than 5 search results for a particular search string. In that case, balala's approach using lookarounds/conditionals is recommended, and it could be of course adapted to my regex.

In the current version, if there are less than 5 results (or no results at all), the regex obviously fails and doesn't capture any of those results. With lookarounds/conditionals in the right place(s), the same regex would capture as many "items" as there are available.
User avatar
balala
Rainmeter Sage
Posts: 10093
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Creating a skin that displays text from a reference manual

Post by balala »

eclectic-tech wrote:
March 21st, 2020, 2:46 pm
I too had the same results with the first code... the one supplied by Yincognito works, in fact it works on other sites too!

Thanks to balala's and Yincognito's code, I was able to expand the skin to accept a search input, and have a context menu list of site to select: Google Docs, Microsoft Docs, Oracle Docs, and Rainmeter Docs!

This is like getting a birthday present from all of you! CieroCeramics for the idea, and balala/Yincognito for the initial code!
Thanks! :great:

DocSearch.ini
Another possibility is to avoid skin refresh whenever you are choosing another site, from the context menu. I'm not entirely sure this is a good approach in this case, but I always tend to avoid as much as possible the refresh.
Just in case anyone is interested, below I post eclectic-tech's modified code, which as said, is not refreshed every time you're selecting a new site to work with. Please let me know what do you think about this small modification. Is it useful? I can1t decide, to be honest...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Google Docs
ContextAction=[!SetVariable Site "Google.com"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
ContextTitle2=Microsoft Docs
ContextAction2=[!SetVariable Site "Microsoft.com"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
ContextTitle3=Oracle Docs
ContextAction3=[!SetVariable Site "Oracle.com"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
ContextTitle4=Rainmeter Docs
ContextAction4=[!SetVariable Site "Rainmeter.net"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
ContextTitle5=---
ContextTitle6=More actions...
ContextAction6=[!SkinMenu]

[Variables]
Site=Google.com
Item=.*<div class="g".*>.*<div class="rc".*>.*<div class="r".*>.*<a href="(.*)".*>.*<h3 class=".*">(.*)</h3>.*<div class="s".*>.*<span class="st".*>(.*)</span>
ToSearch=style
TagCleaner="(?siU)<([^\s]+)(?: .+)?>":""
TooltipW=300

[StringStyle]
X=0
Y=0R
W=300
ClipString=1
Padding=15,2,15,2
FontColor=255,255,255
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontSize=10
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
MouseOverAction=[!SetOption #CURRENTSECTION# InlineSetting "Underline"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# InlineSetting "None"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]

[MeasureSiteTitle]
Measure=String
String=#Site#
RegExpSubstitute=1
Substitute="^(.*)\..*$":"\1"
DynamicVariables=1

[MeasureInputText]
Measure=Plugin
Plugin=InputText
InputLimit=0
InputNumber=0
X=15
Y=6
W=300
H=16
Command1=[!WriteKeyValue Variables ToSearch "$UserInput$"]
Command2=[!Refresh "#CURRENTCONFIG#"]
DefaultValue=#ToSearch#
; Password=
; SolidColor=
FontColor=0,0,0
FontFace=SegoeUI
FontSize=10
; StringStyle=
; StringAlign=
FocusDismiss=1

[MeasureIPinfo]
Measure=WebParser
UpdateRate=3600
Url=https://www.google.com/search?sitesearch=docs.#Site#&q=#ToSearch#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0
RegExp=(?siU).*<div id="search".*>.*<div class="srg".*>#Item##Item##Item##Item##Item#.*
DynamicVariables=1

[MeasureAddress1]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=1

[MeasureTitle1]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=2
DecodeCharacterReference=1

[MeasureExtract1]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=3
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"
DynamicVariables=1

[MeasureAddress2]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=4

[MeasureTitle2]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=5
DecodeCharacterReference=1

[MeasureExtract2]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=6
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"

[MeasureAddress3]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=7

[MeasureTitle3]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=8
DecodeCharacterReference=1

[MeasureExtract3]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=9
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"

[MeasureAddress4]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=10

[MeasureTitle4]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=11
DecodeCharacterReference=1

[MeasureExtract4]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=12
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"

[MeasureAddress5]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=13

[MeasureTitle5]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=14
DecodeCharacterReference=1

[MeasureExtract5]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=15
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"

[MeterBackgground]
Meter=Shape
X=0
Y=0
; Shape=Rectangle X,Y,W,H,{Rx},{Ry} | StrokeWidth 2 | Stroke Color 0,0,0,255 | Fill Color 255,255,255,255
Shape=Rectangle 0,0,330,145,3 | Fill Color 0,0,0,80 | StrokeWidth 1 | StrokeColor 0,0,0,220
; Documentation: https://docs.rainmeter.net/manual-beta/meters/shape/#Rectangle

[MeterSearch]
Meter=STRING
X=0
Y=0
W=300
Padding=15,5,15,5
FontColor=255,255,255
FontEffectColor=0,0,0
SolidColor=0,0,0,100
StringEffect=Shadow
FontSize=10
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=[&MeasureSiteTitle] Doc Search for "#ToSearch#":
LeftMouseUpAction=!CommandMeasure "MeasureInputText" "ExecuteBatch 1-2"

[MeterTitle1]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle1
LeftMouseUpAction=["[MeasureAddress1]"]
TooltipText="[MeasureExtract1]"
TooltipWidth=#TooltipW#
DynamicVariables=1

[MeterTitle2]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle2
LeftMouseUpAction=["[MeasureAddress2]"]
TooltipText="[MeasureExtract2]"
TooltipWidth=#TooltipW#
DynamicVariables=1

[MeterTitle3]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle3
LeftMouseUpAction=["[MeasureAddress3]"]
TooltipText="[MeasureExtract3]"
TooltipWidth=#TooltipW#
DynamicVariables=1

[MeterTitle4]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle4
LeftMouseUpAction=["[MeasureAddress4]"]
TooltipText="[MeasureExtract4]"
TooltipWidth=#TooltipW#
DynamicVariables=1

[MeterTitle5]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle5
LeftMouseUpAction=["[MeasureAddress5]"]
TooltipText="[MeasureExtract5]"
TooltipWidth=#TooltipW#
DynamicVariables=1
Padding=15,2,15,5
And a comment related to eclectic-tech's code: the Padding option doesn't make too much sense on [MeterTitle5], because it is used from the [StringStyle] section. Not an error however, but just saw and had to say it. Hope you don't mind, eclectic-tech.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3875
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Creating a skin that displays text from a reference manual

Post by eclectic-tech »

@ Yincognito
Good point! I will look into using lookahead in the parse, like you, right now I am still "tinkering" with this idea :D

@ balala
Yes, I took the "brute force" approach in the context menu's, I agree that simply updating the parent parse measure is probably the better approach. And the code could probably use other optimization :Whistle
User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Creating a skin that displays text from a reference manual

Post by Yincognito »

eclectic-tech wrote:
March 21st, 2020, 5:35 pm
@ Yincognito
Good point! I will look into using lookahead in the parse, like you, right now I am still "tinkering" with this idea :D
Yeah, no need to tinker with them things anymore... ;-)

- the conditional lookaround:

Code: Select all

Item=(?(?=.*<div class="g".*>).*<div class="g".*>.*<div class="rc".*>.*<div class="r".*>.*<a href="(.*)".*>.*<h3 class=".*">(.*)</h3>.*<div class="s".*>.*<span class="st".*>(.*)</span>)
- the regex (apparently, the .*<div class="srg".*> part wasn't "persistent" in the page source, so I removed it):

Code: Select all

RegExp=(?siU).*<div id="search".*>#Item##Item##Item##Item##Item#.*
Test case scenarios (using the "old" https://www.google.com/search?sitesearch=docs.rainmeter.net&q=#ToSearch# URL):
- ToSearch=food => 0 results displayed, all ok
- ToSearch=msi => 1 result displayed, all ok
- ToSearch=webparser => 5 results displayed, all ok
User avatar
balala
Rainmeter Sage
Posts: 10093
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Creating a skin that displays text from a reference manual

Post by balala »

eclectic-tech wrote:
March 21st, 2020, 5:35 pm
@ balala
Yes, I took the "brute force" approach in the context menu's, I agree that simply updating the parent parse measure is probably the better approach. And the code could probably use other optimization :Whistle
Always and all codes could use optimizations. As I said, I'm not sure which solution is the better one. I'm not sure at all that dynamically setting the variables is better in any way.
User avatar
Cordemanon
Posts: 5
Joined: April 30th, 2016, 6:03 am
Location: Dexter, MI, USA

Re: Creating a skin that displays text from a reference manual

Post by Cordemanon »

After reading this topic with abject fascination, I have come to the conclusion that as a code writer I am definitely out of my league.
I've been playing around with Rainmeter for a couple of years now, and I've long thought that having a dedicated skin that shows the Rainmeter manual would be a lot more helpful than trying to print out or download the manual for referencing. Given that this search skin is available, would it be possible to modify it in such a way that it produces only results from the Rainmeter docs?
User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Creating a skin that displays text from a reference manual

Post by Yincognito »

Cordemanon wrote:
March 29th, 2020, 5:44 pm
After reading this topic with abject fascination, I have come to the conclusion that as a code writer I am definitely out of my league.
I've been playing around with Rainmeter for a couple of years now, and I've long thought that having a dedicated skin that shows the Rainmeter manual would be a lot more helpful than trying to print out or download the manual for referencing. Given that this search skin is available, would it be possible to modify it in such a way that it produces only results from the Rainmeter docs?
Haha, don't worry, the league is open to promotion and relegation, so to speak - everybody has a place, and can rise or fall as time goes by. ;-)

That being said, even more helpful would be to experiment and work with the code, instead of knowing the manual by heart and failing to write an effective piece of code. But since you mentioned producing results from the Rainmeter docs only, doesn't setting the URL to https://www.google.com/search?sitesearch=docs.rainmeter.net&q=#ToSearch# provide you with that? Or you're using one of the various versions of the skins posted here and you don't know how to modify it (and if so, which one)? Please clarify.
User avatar
CieroCeramics
Posts: 4
Joined: March 19th, 2020, 11:08 pm

Re: Creating a skin that displays text from a reference manual

Post by CieroCeramics »

Yincognito wrote:
March 29th, 2020, 6:38 pm
Haha, don't worry, the league is open to promotion and relegation, so to speak - everybody has a place, and can rise or fall as time goes by. ;-)

That being said, even more helpful would be to experiment and work with the code, instead of knowing the manual by heart and failing to write an effective piece of code. But since you mentioned producing results from the Rainmeter docs only, doesn't setting the URL to https://www.google.com/search?sitesearch=docs.rainmeter.net&q=#ToSearch# provide you with that? Or you're using one of the various versions of the skins posted here and you don't know how to modify it (and if so, which one)? Please clarify.
feeling somewhat ashamed at my lack of skills and overwhelemed with the your guyses talent rendered me a silent observer of this.
however seeing the interaction between Yincognito and cordemanon gave me a new burst of hope. I have been using what I have been calling DocuGetv3 by eclectic-tech (v1 by balala and v2 by yincognito)
for some reason the skin is not properly searching anymore, and instead appearing blank. I think this might be an issue with the google search URL or the User agent. which when trying to look into I was VERY overwhelmed with info that I simply did not understand.


now about me wanting it to load the whole page into a scrollable rainmeter window...
Balala wrote:Why? I doubt this would be a good idea. What can you do with the whole content of a page?
Yincognito wrote:Ok now, first let me say that parsing entire HTML pages, while not (technically) impossible using regex, is going to be very tough - and I have some experience in that, LOL. The bare text might be "easier" to get (by, say, eliminating tags </tag>.*</tag> from the page source, along with expertly extracting the right strings from within quotes), but if you want to convert HTML headings and such into Rainmeter inline format ... well, let's say it's going to take a LOT of effort (to put it mildly).

My advice is to just open the desired page in a browser and be done with it. There's going to be way too much effort (and, to be honest with you, way too less experience in regex for you) to even attempt to do otherwise.

EDIT: You could however try a limited approach to this, taking advantage of Google's work, balala's sample and my "improved" regex above to get a short "summary"/ "extract" of the linked page in tooltips (you can, of course, make it more elegant than this, although I doubt you'd need scrollbars for it):
I know it seems silly, why the heck would I want that. well it's simple. I am a huge sucker for my sexy UI and I will not compromise.the clunky nature of modern browsers is simply too disruptive to my workflow.
that being said, what I want IS possible. look at this lua script. (which I totally snagged)

Code: Select all

local t = [[ some long html stuff in here ]]

local cleaner = {
	{ "&amp;", "&" },
	{ "&#151;", "-" },
	{ "&#146;", "'" },
	{ "&#160;", " " },
	{ "<br.*/>", "\n" },
	{ "</p>", "\n" },
	{ "(%b<>)", "\n" },
	{ "\n\n*", "\n" },
	{ "\n*$", "" },
	{ "^\n*", "" },
}
for i=1, #cleaner do
	local cleans = cleaner[i]
	t = string.gsub( t, cleans[1], cleans[2] )
end

print(t)

that'll get you a really nice clean Documentation page. especially if its from a docs website. try it on rainmeter. the only thing I can't seem to get rid of is the annoying meta tags. which only represents the top half of the page.
I have come to understand regex is really more of a word by word. nay, character by character parsing method, but there's gotta be a way to get rid of those meta tags. and then. once you get that .txt file.
parse it with the ever famed jsmorelys lua scroll text
putting this together should theoretically be simple. but without a working example for parsing the actual web data I am left helpless in going any further.

thanks for all the interest guys, you have truly warmed my heart to this community and made me feel valued for my idea. but most of all for helping one of my dreams come true, even if it was for a brief moment.

here is a snapshot to illustrate both points in my post. the search no longer displays results. sad face
the lua scroll text combined with lua HTML cleaner is definitely a thing, albeit without styling, happy face
Image
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3875
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Creating a skin that displays text from a reference manual

Post by eclectic-tech »

CieroCeramics wrote:
March 30th, 2020, 10:26 pm
feeling somewhat ashamed at my lack of skills and overwhelemed with the your guyses talent rendered me a silent observer of this.
however seeing the interaction between Yincognito and cordemanon gave me a new burst of hope. I have been using what I have been calling DocuGetv3 by eclectic-tech (v1 by balala and v2 by yincognito)
for some reason the skin is not properly searching anymore, and instead appearing blank. I think this might be an issue with the google search URL or the User agent. which when trying to look into I was VERY overwhelmed with info that I simply did not understand.
This code is working for me. Hopefully, you can incorporate your scrolling text using these results.

DocSearch.ini

Code: Select all

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

RightMouseUpAction=[!SkinCustomMenu]

ContextTitle=Google Docs
ContextAction=[!WriteKeyValue "Variables" "Site" "Google.com"][!SetVariable "Site" "Google.com"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
ContextTitle2=Microsoft Docs
ContextAction2=[!WriteKeyValue "Variables" "Site" "Microsoft.com"][!SetVariable "Site" "Microsoft.com"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
ContextTitle3=Oracle Docs
ContextAction3=[!WriteKeyValue "Variables" "Site" "Oracle.com"][!SetVariable "Site" "Oracle.com"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
ContextTitle4=Rainmeter Docs
ContextAction4=[!WriteKeyValue "Variables" "Site" "Rainmeter.net"][!SetVariable "Site" "Rainmeter.net"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
ContextTitle5=---
ContextTitle6=More actions...
ContextAction6=[!SkinMenu]

[Variables]
Site=Microsoft.com
Item=(?(?=.*<div class="g".*>).*<div class="g".*>.*<div class="rc".*>.*<div class="r".*>.*<a href="(.*)".*>.*<h3 class=".*">(.*)</h3>.*<div class="s".*>.*<span class="st".*>(.*)</span></div>)
ToSearch=google
TagCleaner="(?siU)<([^\s]+)(?: .+)?>":""
TooltipW=300

[StringStyle]
X=0
Y=0R
W=300
ClipString=1
Padding=15,2,15,2
FontColor=255,255,255
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontSize=10
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
MouseOverAction=[!SetOption #CURRENTSECTION# InlineSetting "Underline"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# InlineSetting "None"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]

[MeasureSiteTitle]
Measure=String
String=#Site#
RegExpSubstitute=1
Substitute="^(.*)\..*$":"\1"
DynamicVariables=1

[MeasureInputText]
Measure=Plugin
Plugin=InputText
InputLimit=0
InputNumber=0
X=15
Y=6
W=300
H=16
Command1=[!SetOption MeterTitle1 Text "%1"][!UpDateMeter MeterTitle1][!Redraw][!WriteKeyValue Variables ToSearch "$UserInput$"][!SetVariable "ToSearch" "[MeasureInputText]"][!UpdateMeasure "MeasureIPinfo"][!UpdateMeasure "MeasureSiteTitle"][!CommandMeasure "MeasureIPinfo" "Update"]
DefaultValue=#ToSearch#
FontColor=0,0,0
FontFace=SegoeUI
FontSize=10
FocusDismiss=1

[MeasureIPinfo]
Measure=WebParser
UpdateRate=3600
Url=https://www.google.com/search?sitesearch=docs.#Site#&q=#ToSearch#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0
RegExp=(?siU).*<div id="search".*>#Item##Item##Item##Item##Item#.*
DynamicVariables=1
LogSubstringErrors=0

[MeasureAddress1]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=1

[MeasureTitle1]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=2
DecodeCharacterReference=1
IfMatch=^$
IfMatchAction=[!SetOption MeterTitle1 Text "No documents found!"][!UpDateMeter MeterTitle1][!Redraw]
IfNotMatchAction=[!SetOption MeterTitle1 Text "%1"][!UpDateMeter MeterTitle1][!Redraw]

[MeasureExtract1]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=3
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"
DynamicVariables=1

[MeasureAddress2]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=4

[MeasureTitle2]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=5
DecodeCharacterReference=1

[MeasureExtract2]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=6
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"

[MeasureAddress3]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=7

[MeasureTitle3]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=8
DecodeCharacterReference=1

[MeasureExtract3]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=9
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"

[MeasureAddress4]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=10

[MeasureTitle4]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=11
DecodeCharacterReference=1

[MeasureExtract4]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=12
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"

[MeasureAddress5]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=13

[MeasureTitle5]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=14
DecodeCharacterReference=1

[MeasureExtract5]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=15
DecodeCharacterReference=1
RegExpSubstitute=1
Substitute="#TagCleaner#"

[MeterBackgground]
Meter=Shape
X=0
Y=0
; Shape=Rectangle X,Y,W,H,{Rx},{Ry} | StrokeWidth 2 | Stroke Color 0,0,0,255 | Fill Color 255,255,255,255
Shape=Rectangle 0,0,330,145,3 | Fill Color 0,0,0,80 | StrokeWidth 1 | StrokeColor 0,0,0,220
; Documentation: https://docs.rainmeter.net/manual-beta/meters/shape/#Rectangle

[MeterSearch]
Meter=STRING
X=0
Y=0
W=300
Padding=15,5,15,5
FontColor=255,255,255
FontEffectColor=0,0,0
SolidColor=0,0,0,100
StringEffect=Shadow
FontSize=10
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=[&MeasureSiteTitle] Doc Search for "#ToSearch#":
LeftMouseUpAction=!CommandMeasure "MeasureInputText" "ExecuteBatch 1"
DynamicVariables=1

[MeterTitle1]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle1
LeftMouseUpAction=["[MeasureAddress1]"]
TooltipText="[MeasureExtract1]"
TooltipWidth=#TooltipW#
DynamicVariables=1

[MeterTitle2]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle2
LeftMouseUpAction=["[MeasureAddress2]"]
TooltipText="[MeasureExtract2]"
TooltipWidth=#TooltipW#
DynamicVariables=1

[MeterTitle3]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle3
LeftMouseUpAction=["[MeasureAddress3]"]
TooltipText="[MeasureExtract3]"
TooltipWidth=#TooltipW#
DynamicVariables=1

[MeterTitle4]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle4
LeftMouseUpAction=["[MeasureAddress4]"]
TooltipText="[MeasureExtract4]"
TooltipWidth=#TooltipW#
DynamicVariables=1

[MeterTitle5]
Meter=STRING
MeterStyle=StringStyle
MeasureName=MeasureTitle5
LeftMouseUpAction=["[MeasureAddress5]"]
TooltipText="[MeasureExtract5]"
TooltipWidth=#TooltipW#
DynamicVariables=1
Padding=15,2,15,5
Edit: Update #Text# variable to use the RegExp code suggested by Yincognito's.
User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Creating a skin that displays text from a reference manual

Post by Yincognito »

eclectic-tech wrote:
April 2nd, 2020, 3:27 am
This code is working for me. Hopefully, you can incorporate your scrolling text using these results.
A slight update of the Item variable's regex, to handle an "undiscovered" before <span class="f">...</span> holding the date of the searched article ... inside the actual <span class="st">...</span> that holds the summary "extract" of the article:

Code: Select all

Item=(?(?=.*<div class="g".*>).*<div class="g".*>.*<div class="rc".*>.*<div class="r".*>.*<a href="(.*)".*>.*<h3 class=".*">(.*)</h3>.*<div class="s".*>.*<span class="st".*>(.*)</span></div>)
Hopefully, there won't be any more such suprises in the page source, as it's better to keep this regex relatively simple, in order to be able to be flexible enough in different scenarios.