It is currently April 27th, 2024, 5:20 am

Little help

Get help with creating, editing & fixing problems with skins
madsen
Posts: 2
Joined: January 19th, 2021, 1:04 am

Re: Little help

Post by madsen »

JamX wrote: January 19th, 2021, 5:18 am change the ExpQuote variable with following code
Thanks alot JamX!

It didn't take "prices" with commas, only period so i fixed it with this:

Code: Select all

ExpQuote=(?siU).*"name":"(.*)".*"price":"(\d+[,.]\d{0,2}+).*"priceChange":"(.*)".*"priceChangePercent":"(.*)"
Works perfect again :)
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

:thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

madsen wrote: January 19th, 2021, 6:49 pm Thanks alot JamX!

It didn't take "prices" with commas, only period so i fixed it with this:

Code: Select all

ExpQuote=(?siU).*"name":"(.*)".*"price":"(\d+[,.]\d{0,2}+).*"priceChange":"(.*)".*"priceChangePercent":"(.*)"
Works perfect again :)
Be aware that if you have prices without a decimal separator (e.g. 124 instead of 124.0 or 124,0 i.e. stuff without a period or a comma, depending on region) the above won't work. Just saying...
But then, maybe the site always provides decimally separated prices, who knows?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Little help

Post by Mordasius »

The MarketPrices skin was updated on Deviant Art a few days ago. The latest version uses the following RegExp:

ExpQuote=(?siU).*Intangible/FinancialQuote.*"name":"(.*)".*"price":"(.*)".*"priceChange":"(\+|\-?.*)".*"priceChangePercent":"(\+|\-?.*)"

Give it a try and it just might work.

ALSO: Please, please don't use update rates less than the default UpdateQuotes=600 which is once every ten minutes. If you do you could end up getting Webparser and all other Rainmeter users blocked from the site! I suspect this was what happened on the previous Bloomberg version when one ignoramus insisted on updating once every minute despite being repeatedly told the site only updated the prices every 2-3 minutes.

-- I've just been watching the Asian markets and prices from the Heng Seng and Shanghai exchanges are only updated every sixty-seventy (60-70) minutes.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

Mordasius wrote: January 20th, 2021, 3:47 amThe latest version uses the following RegExp:

ExpQuote=(?siU).*Intangible/FinancialQuote.*"name":"(.*)".*"price":"(.*)".*"priceChange":"(\+|\-?.*)".*"priceChangePercent":"(\+|\-?.*)"

Give it a try and it just might work.
Agreed, it seems much better to just capture the whole value and then manipulate decimals or whatever in a RegExp Substitute, instead of trying to directly get stuff formatted as you want to from the WebParser measure's RegExp.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth