Created
September 14, 2011 03:35
-
-
Save terrycojones/1215802 to your computer and use it in GitHub Desktop.
elisp to insert a user's last page.
This file contains hidden or 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 'fluiddb) | |
(setq *fluiddb-credentials* '("terrycojones" . "SECRET")) | |
(defun insert-lastpage (who) | |
(interactive "sInsert the last URL of which user? ") | |
(let* | |
((user (or who (car *fluiddb-credentials*))) | |
(result (fluiddb-query-objects-tag-values | |
(format "has %s/lastpage" user) | |
'("fluiddb/about")))) | |
(insert (cdr (car (cdr (car (cdr (car (cdr (car (cdr (car (car (cdr result))))))))))))))) | |
(defun clear-lastpage (who) | |
(interactive "sClear the last URL of which user? ") | |
(let* | |
((tag (format "%s/lastpage" (or who (car *fluiddb-credentials*))))) | |
(fluiddb-delete-objects-tag-values (format "has %s" tag) (list tag)))) | |
(defun set-lastpage (who url) | |
(interactive "sSet the last URL of which user? \nsURL: ") | |
(let* | |
((user (if (equal who "") (car *fluiddb-credentials*) who)) | |
(tag (format "%s/lastpage" user))) | |
(clear-lastpage user) | |
(fluiddb-set-object-about-tag-value url tag nil))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment