Browse Source

Fix render-tweet

PuercoPop 11 years ago
parent
commit
d7ef24664d
1 changed files with 7 additions and 3 deletions
  1. 7 3
      plugins/twitter.lisp

+ 7 - 3
plugins/twitter.lisp

7
 
7
 
8
 (in-package :coleslaw-twitter)
8
 (in-package :coleslaw-twitter)
9
 
9
 
10
-(defvar *tweet-format* '("~A" (title post) (text content))
11
-  "Controls what the tweet annoucing the post looks like. It is the made up of a format control string followed with the pertinent variables.")
10
+(defvar *tweet-format* '("~A by ~A" coleslaw::post-title coleslaw::post-author)
11
+  "Controls what the tweet annoucing the post looks like. It contains a format
12
+  control string followed with the accesors to evaluate for post.")
12
 
13
 
13
 (defun enable (&key api-key api-secret access-token access-secret tweet-format)
14
 (defun enable (&key api-key api-secret access-token access-secret tweet-format)
14
   (if (and api-key api-secret access-token access-secret)
15
   (if (and api-key api-secret access-token access-secret)
42
 
43
 
43
 (defun render-tweet (post)
44
 (defun render-tweet (post)
44
   "Sans the url, which is a must."
45
   "Sans the url, which is a must."
45
-  (apply #'format (append '(nil) *tweet-format*)))
46
+  (apply #'format `(nil ,(car *tweet-format*)
47
+                        ,@(loop
48
+                             :for accesor in (cdr *tweet-format*)
49
+                             :collect (funcall accesor post)))))