json-parse string expected

Started by joejoe, May 06, 2018, 02:49:51 AM

Previous topic - Next topic

joejoe

Hi,



(json-parse (exec "curl https://www.asdf.com/asdf.json">https://www.asdf.com/asdf.json"))



I am getting the message that a string is expected.



The result of the exec has [text]......[/text] at the beginning and end of what is returned.



Is this why json-parse thinks it is not a string?



I tried (json-parse (string (exec "curl....))) too. Still says a string is expected.



How do I remove the [text] ... [/text] so that the result can be interpreted by (json-parse)?



Thanks!

TedWalther

#1
Are you sure the link is spelled correctly?  When I click the link, I get "page not found".
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

joejoe

#2
Thanks again Ted,! I was able to do it with get-url here.


(json-parse (get-url "https://pastebin.com/raw/brx7F2vA"))


(("ID" ("1" "2" "3" "4" "5" "6" "7" "8")) ("Name" ("Rick" "Dan" "Michelle" "Ryan"            
   "Gary" "Nina" "Simon" "Guru"))                                                            
 ("Salary" ("623.3" "515.2" "611" "729" "843.25" "578" "632.8" "722.5"))                      
 ("StartDate" ("1/1/2012" "9/23/2013" "11/15/2014" "5/11/2014" "3/27/2015" "5/21/2013"        
   "7/30/2013" "6/17/2014"))
 ("Dept" ("IT" "Operations" "IT" "HR" "Finance" "IT" "Operations" "Finance")))