Skip to content

Instantly share code, notes, and snippets.

@wfarr
Created March 7, 2009 07:08
Show Gist options
  • Select an option

  • Save wfarr/75257 to your computer and use it in GitHub Desktop.

Select an option

Save wfarr/75257 to your computer and use it in GitHub Desktop.
(defun yql-yahoo-search (query)
(let ((result (yql-filter 'result
(yql-select "title,abstract,url" "search.web"
(concat (format "query=\"%s\"" query)
"LIMIT 5")))))
(save-excursion
(set-buffer (get-buffer-create "*Search Results*"))
(dolist (item result)
(let ((title (yql-filter 'title item))
(abstract (yql-filter 'abstract item))
(url (yql-filter 'url item)))
(insert (concat title "\n " abstract "\n " url "\n"))))
(goto-address)
(switch-to-buffer-other-window "*Search Results*"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment