Guest User

Untitled

a guest
Feb 28th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. ;;; hatena-let.el ---
  2.  
  3. ;; Copyright (C) 2010 Kentaro Kuribayashi
  4.  
  5. ;; Keywords: javascript
  6.  
  7. ;; This program is free software; you can redistribute it and/or modify
  8. ;; it under the terms of the GNU General Public License as published by
  9. ;; the Free Software Foundation, either version 3 of the License, or
  10. ;; (at your option) any later version.
  11.  
  12. ;; This program is distributed in the hope that it will be useful,
  13. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;; GNU General Public License for more details.
  16.  
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  19.  
  20. ;;; Commentary:
  21.  
  22. ;; hatena-let.el requires deferred.el
  23. ;; (https://github.com/kiwanami/emacs-deferred)
  24.  
  25. ;; in your .emacs:
  26.  
  27. ;; (require 'hatena-let)
  28. ;; (setq hatena-let/apikey " ... ")
  29.  
  30. ;;; Code:
  31.  
  32. (eval-when-compile
  33. (require 'deferred))
  34.  
  35. (defvar hatena-let/apikey "" "Your API key for Hatena::Let")
  36.  
  37. (defun hatena-let/save-code ()
  38. (interactive)
  39. (if (or (not hatena-let/apikey) (string= hatena-let/apikey ""))
  40. (error "API key is required")
  41. (deferred:$
  42. (deferred:url-post
  43. "http://let.hatelabo.jp/api/code.save"
  44. `(("api_key" . ,hatena-let/apikey) ("source" . ,(buffer-string)))))))
  45.  
  46. (provide 'hatena-let)
  47. ;;; hatena-let.el ends here
Add Comment
Please, Sign In to add comment