Help with Curl Regex ( is this ever possible)

Hi there,

I am still trying to pull in stats from Chess.com about games played to track.

They have an API and Beeminder /can/ access their API call -

https://api.chess.com/pub/player/baronvonchickenpants/stats

The section I am interested in is this :-

“chess_rapid”: {
“last”: {
“rating”: 1354,
“date”: 1751201893,
“rd”: 81
},
“best”: {
“rating”: 1525,
“date”: 1725655910,
“game”: “Chess: Dannibees vs BaronVonChickenpants - Chess.com
},
“record”: {
“win”: 202,
“loss”: 169,
“draw”: 11
}

I want to add up the win/loss/draw numbers withing that bottom ‘record’ section and Beemind the total number.

Is this possible with the regex / curl integration? Can a Regex sum nubmers or is it just extracting the one figure?

If the former, can anyone help write it?

If the latter can I extract each separately and somehow have some meta goal to track the total?

1 Like

I think the answer is no, you can’t use a regex to sum the numbers like you need. I think the best approach would be to use something like val.town to parse and add up the numbers and then post the result to your Beeminder goal using the Beeminder API.

How comfortable are you writing some basic javascript?

If you’d rather avoid writing code, you could use make.com instead to do the same thing using a visual automation builder.

1 Like