Created
September 26, 2012 13:26
-
-
Save sdqali/3788028 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'url) | |
(require 'json) | |
(defun ud-define (wd) | |
(interactive "M") | |
(let ((url-request-method "GET")) | |
(url-retrieve (concat "http://urbanscraper.herokuapp.com/define/" wd ".json") | |
(lambda (x) | |
(goto-char (point-min)) | |
(search-forward-regexp "\{.*") | |
(setq word-definition (gethash "definition" | |
(let ((json-object-type 'hash-table)) | |
(json-read-from-string (match-string-no-properties 0))))))) | |
(message word-definition))) | |
(ud-define "bazooka") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment