Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ql:quickload :drakma)
- (ql:quickload :yason)
- (ql:quickload :quri)
- (defun google-search-uri (querystring)
- (quri:render-uri (quri:make-uri :scheme "https"
- :host "suggestqueries.google.com"
- :path "/complete/search"
- :query `(("output" . "firefox")
- ("q" . ,querystring)))))
- (defun google-search-suggestion (querystring)
- (nth 1 (let ((stream (drakma:http-request (google-search-uri querystring)
- :want-stream t)))
- (setf (flexi-streams:flexi-stream-external-format stream) :utf-8)
- (yason:parse stream :object-as :plist))))
- (google-search-suggestion "lisp")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement