all repos — website @ 260e64f831822c6a8eb2ffdc5a6be3722cbb72c8

personal website hosted at prithu.xyz, built using hugo

update post

jq
- api > API
- $ curl > curl
Prithu Goswami prithugoswami524@gmail.com
Fri, 01 May 2020 19:11:41 +0530
commit

260e64f831822c6a8eb2ffdc5a6be3722cbb72c8

parent

26bd61d2ce7c67cd31c716ab011f9df5f4207057

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M hugo-site/content/posts/jq/index.mdhugo-site/content/posts/jq/index.md

@@ -23,14 +23,14 @@ in from other programs into it. `jq` has a very straight forward man page. It

has a mini language of it's own which is quite intuitive. The command below fetches the information using cricbuzz. Turns out they have -an undocumented api that is publicly usable. We get the score of the batting +an undocumented API that is publicly usable. We get the score of the batting side and also the status of the match. ` tr -d \" | tr \n ' '` gets rid of double quotes and converts the newlines into spaces. {{< highlight bash >}} #!/usr/bin/bash -$ curl -s https://www.cricbuzz.com/match-api/livematches.json\ +curl -s https://www.cricbuzz.com/match-api/livematches.json\ | jq '.matches."22455"|.score.batting.score,.status'\ | tr -d \" | tr '\n' ' '