It is currently April 25th, 2024, 1:02 am

Help With Json in Rainmeter

Get help with creating, editing & fixing problems with skins
ImportedDj
Posts: 20
Joined: May 1st, 2014, 1:46 pm

Help With Json in Rainmeter

Post by ImportedDj »

Hey guys,

This is first major project with Rainmeter.. I'm trying to get some Json Information to load however nothing is being displayed.. Is anyone able to assist in where i could have gone wrong or why nothing is being displayed?

this is my current Code

Code: Select all

[MeasureSite]
Measure=Plugin
Plugin=WebParser.dll
URL=https://prod.api.pvp.net/api/lol/na/v1.4/summoner/by-name/RiotSchmick?api_key=**
RegExp=(?siU)"name":"(.*)"
UpdateRate=600

[MeasureSummoners]
Measure=Plugin
Plugin=WebParser.dll
URL=[MeasureSite]
StringIndex=1



[TextStyle]
FontFace=Ariel
FontColor=212,255,213
StringStyle=Bold
StringAlign=Right
AntiAlias=1


[MeterText]
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureSummoners
FontSize=10

[MeterImage]
meter = image
ImageName = bastion.png
x = 0
y = 0
the Text retrieved from the website is
{"riotschmick":{"id":585897,"name":"RiotSchmick","profileIconId":642,"summonerLevel":30,"revisionDate":1398901685000}}
*Edit to this post..
When going through the 'About' Window for this section.. if i have (?siU)"name":"(.*)" Is will return a Value however if i do RegExp=(?siU)"name":"(.*)","summonerLevel":"(.*)" It returns blank..

**Edit 2:
I've gone and downloaded RainRegExp in order to attempt to find a solution.. I've run into the error
Error = 1: Could not match all searches.

If you have a lot of search strings, try removing
them one at a time until your search succeeds and
you will have found the failing part of the search.
Upon Googling this i have tried \r \n \r\n to no solution, Anyone have any ideas on this?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help With Json in Rainmeter

Post by eclectic-tech »

::Your RegExp Coding::

Original RegExp:
RegExp=(?siU)"name":"(.*)","summonerLevel":"(.*)"

Corrected:
RegExp=(?siU)"name":"(.*)",.*"summonerLevel":(.*),.*

::::
You could also get all info with...
RegExp=(?siU)name":"(.*)".*summonerLevel":(.*),.*revisionDate":(.*)\}.*

This will return 3 indexes (name, summonerLevel, revisionDate).

Note in the last capture of my RegExp, that the "}" is a reserved character and needs to be escaped using "\" in order to parse correctly.