Wednesday, March 09, 2005

Blogspot posting from Emacs

After setting up your blog to receive messages from a mail, eval this on emacs:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Blogspot email sending:

(defvar blogspot-post-email "yourname.dummy_mail@blogger.com")

(defun blogspot (title url &optional text) "Opens a gnus msg buffer with the active region or the parameters passed in the body. Configure `blogspot-post-email' to set it up." (interactive "sPost title: sPost link: ") (let ((to blogspot-post-email) (subject (cond ((and title url (not (string= url ""))) (concat "" title "")) (title title) (t ""))) (body (or text ""))) (gnus-msg-mail to subject) (save-excursion (when body (raise-frame) (insert body))) (message "Edit your post and press \\C-c \\C-c to post it to %s." blogspot-post-email)))

(defun blogspot-region (beg end title url) "Call `blogspot-text' and inserts the active region as the post's body." (interactive "r sPost title: sPost link: ") (blogspot title url (buffer-substring-no-properties beg end)))

-- Edgar Gonçalves INESC-ID, Software Engineering Group (Technical University of Lisbon) Portugal

0 comments: