summaryrefslogtreecommitdiff
path: root/wttrin.el
diff options
context:
space:
mode:
authorCarl X. Su <bcbcarl@gmail.com>2016-03-06 01:16:39 +0800
committerCarl X. Su <bcbcarl@gmail.com>2016-03-06 01:16:39 +0800
commit6d555045977fc362a7f0da68fa9ff5d81625b10f (patch)
treeb4cb7995ee82ad8398c582188d5ae3806a4278a2 /wttrin.el
parent99ba22f0333e9ff72cf1803af49225a99273bca1 (diff)
parentba9c2c89ae0daf52001e61c21cbeb20be00ecf00 (diff)
Merge pull request #1 from kuanyui/master
Remove HTTP header
Diffstat (limited to 'wttrin.el')
-rw-r--r--wttrin.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/wttrin.el b/wttrin.el
index b2a3d97..199ade6 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -12,6 +12,8 @@
;; Provides the weather information from wttr.in based on your query condition.
;;; Code:
+(require 'url)
+(require 'xterm-color)
(defgroup wttrin nil
"Emacs frontend for weather web service wttr.in."
@@ -32,7 +34,7 @@
(lambda (status) (switch-to-buffer (current-buffer))))
(decode-coding-string (buffer-string) 'utf-8))))
-(require 'xterm-color)
+
(defun wttrin-exec ()
"Display weather information."
(interactive)
@@ -40,6 +42,9 @@
(buf (get-buffer-create name)))
(switch-to-buffer buf))
(insert (xterm-color-filter (wttrin-fetch wttrin-query)))
+ (goto-char (point-min))
+ (re-search-forward "^$")
+ (delete-region (point-min) (1+ (point)))
(setq buffer-read-only t))
(provide 'wttrin)