Create a gist now

Instantly share code, notes, and snippets.

What would you like to do? is an awesome bookmarking service... this here is some EmacsLisp to pull the most recent bookmarks I have made (though it's easy to switch it to you) and present it as creole text. It relies on 2 other packages: creole-mode, web -- both can be found on
;;; pinboard.el --- get stuff from pinboard -*- lexical-binding: t -*-
;; Copyright (C) 2013 Nic Ferrier
;; Author: Nic Ferrier <>
;; Keywords: multimedia
;; Created: 10th March 2013
;; Version: 0.0.1
;; Created: 10th March 2013
;; Url:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <>.
;;; Commentary:
;; is an awesome tool for bookmarking with lots of
;; extensions. This Emacs extension let's you pull the data into a
;; creole-mode file presented in a creole like way.
;; I use it for making quick blog posts of stuff I've pinboarded.
;; I expect there are other uses that I'll add.
;;; Code:
(require 'web)
(require 'json)
(require 'creole-mode)
(defgroup pinboard nil
"Pull data from"
:group 'applications)
(defcustom pinboard-url
(format "" user-login-name)
"Your user, by default it's Emacs `user-login-name'."
:group 'pinboard)
(defun pinboard/data (data)
"The data is a vector of alists."
(with-current-buffer (get-buffer-create "*pinboard-latest*")
(let ((buffer-read-only nil))
(loop for al across data
(setf (car (assoc 't al)) 'tags)
(destructuring-bind (&key tags a dt n d u)
(kvalist->plist al)
(format "=== %s ===
%s\n\n" n u n dt d (mapconcat 'identity tags "|"))))))
(goto-char (point-min))
(switch-to-buffer (current-buffer)))))
(defun pinboard-latest ()
(let ((buf (get-buffer-create "*pinboard-data*")))
(with-current-buffer buf (erase-buffer))
(lambda (htp headers data)
(let ((jsdata
(with-current-buffer buf
(goto-char (point-max))
(insert data)
(goto-char (point-min))
(pinboard/data jsdata)))
:url pinboard-url)))
(provide 'pinboard)
;;; pinboard.el ends here

get stuff from pinboard, turn it into creole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment