Wikipedia:Reference desk/Archives/Computing/2016 September 22
{{#ifeq:{{PAGENAME}}|Special:Undelete| |{{#if:|
Xidel help
Using [http://www.videlibri.de/xidel.html xidel] how would you extract only the "no" data from [http://a.4cdn.org/pol/threads.json this json feed]? The feed contains 150 items each with "no" and "last_modified". I want only the "no" data returned for all 150 items,
For example
{"no":40489590,"last_modified":1421804809},{"no":89921534,"last_modified":1474576329},{"no":89924252,"last_modified":1474576328}
etc would become;
40489590
89921534
89924252
etc. I tried reading the manual and [http://videlibri.sourceforge.net/xidel_readme.txt readme text] but I just can't work out the syntax and I have no experience with json. Thanks for your help! 179.197.26.37 (talk) 20:40, 22 September 2016 (UTC) (Copied from WT:RD edit request. -- ToE 22:49, 22 September 2016 (UTC))
:Have you tried:
xidel http://a.4cdn.org/pol/threads.json -e '$json/threads/no'
:For syntax utilizing other JSON notation, see #11 under http://www.videlibri.de/xidel.html#examples -- ToE 12:32, 23 September 2016 (UTC)
::Following myself up, the XPath-like notation above (-e '$json/threads/no') seems to work on my system and do just what you want, but the other two notations -- JSONiq (-e '$json("threads")("no")') and dot (-e '($json).threads.no') -- yield no output. I don't know anything more about this as I just installed xidel to see if I could help answer your question. I may be missing something simple. -- ToE 17:11, 23 September 2016 (UTC)