probonopd / minikrebs

OpenWrt-based webradio firmware generator for A5-V11, D-Link DIR-505, TP-LINK TL-WR710N and TP-LINK TL-WR703N and USB sound card
13 stars 5 forks source link

Parse radiotime json using jshn #2

Open probonopd opened 8 years ago

probonopd commented 8 years ago

Currently, we are scraping radiotime using grep and head. It would be cleaner to use jshn like so (note that it is not quite working yet):

JSN=$(wget "http://opml.radiotime.com/Tune.ashx?id=s78244&render=json" -O -)
. /usr/share/libubox/jshn.sh
json_load "$JSN"
json_select body
json_get_var var1 url
echo $var1

https://dev.openwrt.org/browser/trunk/package/jshn/example.txt?rev=25652