This is so much easier than using regex, thank you.
I was seeing an error in the log:
Error reading JToken from JsonReader. Path '', line 0, position 0. (devops\Vertical\DevOpsVertical.ini - [MeasurePRCount])
My JSON & selector wasn't the issue; the measure seemed to be working just fine. Just for reference, here's my json/skin.
Rainmeter
Code: Select all
; PR Status
[PRStatus]
Measure=WebParser
URL=https://#CoreServer#/#Organization#/#Project#/_apis/git/repositories/#Repository#/pullrequests?api-version=5.1&searchCriteria.reviewerId=#UserId#
Header=Content-Type: application/json
Header2=Authorization: Basic #AccessToken#
RegExp=(?siU)^(.*)$
[MeasurePRCount]
Measure=Plugin
Plugin=JsonParser.dll
Source=[PRStatus]
Query="count"
IfCondition=MeasurePRCount > 0
IfTrueAction=[!SetOption MeterPRIcon FontColor #VFontColorWorking#]
IfFalseAction=[!SetOption MeterPRIcon FontColor #VFontColor#]
JSON Response
Code: Select all
{
"value": [ ... // removed because this isn't data I can share...
],
"count": 4
}
I realized the issue was that the plugin was throwing an error on the initial update before the WebParser measure had finished. I made this small change to get rid of the error:
Code: Select all
; PR Status
[PRStatus]
Measure=WebParser
URL=https://#CoreServer#/#Organization#/#Project#/_apis/git/repositories/#Repository#/pullrequests?api-version=5.1&searchCriteria.reviewerId=#UserId#
Header=Content-Type: application/json
Header2=Authorization: Basic #AccessToken#
RegExp=(?siU)^(.*)$
FinishAction=[!SetOption MeasurePRCount Disabled 0]
[MeasurePRCount]
Measure=Plugin
Plugin=JsonParser.dll
Source=[PRStatus]
Query="count"
IfCondition=MeasurePRCount > 0
IfTrueAction=[!SetOption MeterPRIcon FontColor #VFontColorWorking#]
IfFalseAction=[!SetOption MeterPRIcon FontColor #VFontColor#]
Disabled=1
It might be worth ignoring empty input.