Skip to content

Instantly share code, notes, and snippets.

@terrycojones
Created September 14, 2011 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrycojones/1215802 to your computer and use it in GitHub Desktop.
Save terrycojones/1215802 to your computer and use it in GitHub Desktop.
elisp to insert a user's last page.
(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