OP 13 March, 2019 - 12:14 AM
There comes a time when you need to format some JSON in unix, in that case, use jq.
Install jq
Using jq
So let's parse some JSON, let's use the nulled feed, first download the feed to a file
Now let's parse some of it, let's try the home stuff
[img=https://i.imgur.com/e6Rwmz4.png]
so if we wanted to get the titles from the .home section of the feed
[img=https://i.imgur.com/1EsHFUP.png]
Install jq
Code:
sudo apt-get -y install jq
So let's parse some JSON, let's use the nulled feed, first download the feed to a file
Code:
curl -s https://www.nulled.to/misc.php?action=getFeed >feed
Code:
jq '.home' feed
so if we wanted to get the titles from the .home section of the feed
Code:
jq '.home[].title' feed
Code:
#!/bin/sh
curl -s https://www.nulled.to/misc.php?action=getFeed >feed
jq '.home[].title' feed
rm feed