Browse Source

Initial commit

Samuel W. Flint 5 years ago
commit
9c2234cf09
2 changed files with 67 additions and 0 deletions
  1. 49 0
      .gitignore
  2. 18 0
      pushover.el

+ 49 - 0
.gitignore

@@ -0,0 +1,49 @@
+# -*- mode: gitignore; -*-
+.*
+!.gitignore
+!.gitmodules
+!.gitkeep
+
+# Emacs Stuff
+*~
+\#*\#
+/.emacs.desktop
+/.emacs.desktop.lock
+*.elc
+auto-save-list
+tramp
+.\#*
+
+# Org-mode
+.org-id-locations
+*_archive
+
+# flymake-mode
+*_flymake.*
+
+# eshell files
+/eshell/history
+/eshell/lastdir
+
+# elpa packages
+/elpa/
+
+# reftex files
+*.rel
+
+# AUCTeX auto folder
+/auto/
+*/auto/
+
+# cask packages
+.cask/
+dist/
+
+# Flycheck
+flycheck_*.el
+
+# server auth directory
+/server/
+
+# projectiles files
+.projectile

+ 18 - 0
pushover.el

@@ -0,0 +1,18 @@
+
+(defconst *pushover-api-key* "agd6sapvp5xcdmbuo1qdpc7mddscri")
+
+(defvar *pushover-user-key* nil)
+
+(cl-defun pushover-send (title message &optional (html nil) (priority 0))
+  (let ((url-request-method "POST")
+        (url-request-data (concat (format "token=%s&user=%s&title=%s&message=%s&priority=%s&timestamp=%s"
+                                          *pushover-api-key*
+                                          *pushover-user-key*
+                                          (url-encode-url title)
+                                          (url-encode-url message)
+                                          priority
+                                          (current-time))
+                                  (if html
+                                      "&html=1"
+                                    ""))))
+    (url-retrieve "https://api.pushover.net/1/messages.json" (lambda (status) (kill-buffer (current-buffer)) t))))