notbenh / next.notbenh.info

I build a silly terminal as my webpage thinggie
1 stars 0 forks source link

have a DDG function that calls duckduckgo for fun #37

Open notbenh opened 10 years ago

notbenh commented 10 years ago

Simply call the json api and return the parsed results. Ideally something that would allow for aliases like spell:

spell -> (q)
  DDG(q).Answer
spell('hypocrit')

would call http://api.duckduckgo.com/?q=spell%20hypocrit&format=json , parse the result and return such that .Answer would resolve correctly.

REF: https://duckduckgo.com/api