Skip to content

Instantly share code, notes, and snippets.

@sachac sachac/Beeminder?
Created Mar 22, 2014

What would you like to do?
;; Totally untested
(defvar clarissa/beeminder-user "example" "Username for Beeminder service.")
(defvar clarissa/beeminder-token "1234" "Token - get this from")
(defun clarissa/beeminder-post (goal datapoint)
(interactive "MGoal: \nMData: \nMToken value: ")
(let ((url-request-data (json-encode `((value . ,datapoint) (auth_token . ,clarissa/beeminder-token))))
(url-request-method "POST")
(url-request-extra-headers '(("Content Type" . "application/json")))
(url-mime-encoding-string "identity"))
(condition-case nil
(format "" clarissa/beeminder-user goal)))))
(defun clarissa/beeminder-org-update ()
(when (org-entry-get "GOAL")
(clarissa/beeminder-post (org-entry-get "GOAL") (or (org-entry-get "POINTS") (read-string "Points")))))
(add-hook 'org-after-todo-state-change-hook 'clarissa/beeminder-org-update)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.