emacsweblogs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacsweblogs] Added Wordpress tags and excerpt to weblogger 1.4.4


From: Aaron Hammitt
Subject: [Emacsweblogs] Added Wordpress tags and excerpt to weblogger 1.4.4
Date: Wed, 17 Mar 2010 21:00:21 -0400

Hello,

I am new to this list and new to weblogger.el. I've used Emacs for a while but am just learning elisp. Anyway, I was a little annoyed by the lack of support for tags and excerpts. After looking through the code I made enough sense of it to get the tags and excerpts working (using mt_keywords and mt_excerpts, and associating them with the "Keywords" and "Summary" fields, respectively).

These are the changes I made:

------- BEGIN DIFF -----
--- weblogger-1.4.4.el Fri Mar 12 08:36:26 2010
+++ weblogger.el Wed Mar 17 13:25:54 2010
@@ -1,5 +1,6 @@
 ;;; weblogger.el --- Weblog maintenance via XML-RPC APIs
 
+;; Modified for Wordpress March 2010 by Aaron Hammitt 
 ;; Copyright (C) 2002-2009 Mark A. Hershberger.
 ;; Inspired by code Copyright (C) 2001 by Simon Kittle.
 ;; Parts Copyright (C) 2007 Wickersheimer Jeremy.
@@ -679,6 +680,8 @@
                                         ; Note that the blogger API on
                                         ; blogger.com is depcrated and
                                         ; broken on this element.
+    (list "Summary"
+  (cdr (assoc "excerpt" entry)))
     (list "From"
   (or (cdr (assoc "authorName"  entry))
       weblogger-server-username))
@@ -1186,6 +1189,8 @@
                                                ; the modified flag
                                                ; themselves if they
                                                ; want to.
+  (message-fetch-field "Summary")
+  (message-goto-summary)
   (if (message-fetch-field "Subject")
       (message-goto-body) ;; If Subject exists, move cursor to message
                           ;; body
@@ -1208,7 +1213,8 @@
  (url         (cdr (assoc-string "link" response t)))
  (description      (assoc-string "description" response))
  (extended         (assoc-string "mt_text_more" response))
- (tags        (cdr (assoc-string "mt_tags" response t)))
+ (tags        (cdr (assoc-string "mt_keywords" response t)))
+ (excerpt     (cdr (assoc-string "mt_excerpt" response t)))
         (categories  (cdr (assoc-string "categories" response t))))
 
     (cond (content
@@ -1265,6 +1271,8 @@
  (cons "dateCreated"  dateCreated))
       (when tags
  (cons "tags"   tags))
+      (when excerpt
+ (cons "excerpt" excerpt))
       (when categories
  (cons "categories"   categories))
       (when textType
@@ -1291,7 +1299,9 @@
          (when (cdr (assoc "content" entry))
            (cons "description" (cdr (assoc "content" entry))))
          (when (cdr (assoc "tags" entry))
-           (cons "mt_tags" (cdr (assoc "tags" entry))))
+           (cons "mt_keywords" (cdr (assoc "tags" entry))))
+         (when (cdr (assoc "excerpt" entry))
+           (cons "mt_excerpt" (cdr (assoc "excerpt" entry))))
          (when (cdr (assoc "categories" entry))
            (cons "categories" (cdr (assoc "categories" entry)))))))
 
@@ -1377,6 +1387,7 @@
    (cons "title"     (or (message-fetch-field "Subject")
  weblogger-default-title))
    (cons "tags" (message-fetch-field "Keywords"))
+   (cons "excerpt" (message-fetch-field "Summary"))
    (when (message-fetch-field "In-Reply-To")
              (cons "trackbacks"
                    (or (message-tokenize-header
------ END DIFF------

This works quite nicely for my with Emacs 23.1 and Wordpress, since I don't care too much about categories (I just use tags and don't bother with categories).

I now see that you have put out a new version, and are using "Summary" for tags and "Keywords" for categories (and nothing for excerpts). I'm debating whether to stick with my patched version or try to stick with the developed version. What am I missing by sticking with 1.4.4?

Also, when using C-c C-n or C-c C-p to go through my messages, it seemed to "unpublish" them by turning them into drafts. Is there a way around this, or am I doing something wrong?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]