|
@@ -3,12 +3,14 @@
|
3
|
3
|
|
4
|
4
|
(defpackage :coleslaw-twitter
|
5
|
5
|
(:use :cl)
|
6
|
|
- (:import-from :coleslaw
|
7
|
|
- :*config*
|
8
|
|
- :deploy
|
9
|
|
- :get-updated-files
|
10
|
|
- :page-url
|
11
|
|
- :plugin-conf-error)
|
|
6
|
+ (:import-from :coleslaw #:*config*
|
|
7
|
+ #:deploy
|
|
8
|
+ #:get-updated-files
|
|
9
|
+ #:find-content-by-path
|
|
10
|
+ #:title-of
|
|
11
|
+ #:author-of
|
|
12
|
+ #:page-url
|
|
13
|
+ #:plugin-conf-error)
|
12
|
14
|
(:export #:enable))
|
13
|
15
|
|
14
|
16
|
(in-package :coleslaw-twitter)
|
|
@@ -20,8 +22,8 @@
|
20
|
22
|
coleslaw:post and returns the tweet content.")
|
21
|
23
|
|
22
|
24
|
(defvar *tweet-format-dsl-mapping*
|
23
|
|
- '((:title . coleslaw::post-title)
|
24
|
|
- (:author . coleslaw::post-author)))
|
|
25
|
+ '((:title . title-of)
|
|
26
|
+ (:author . author-of)))
|
25
|
27
|
|
26
|
28
|
(define-condition malformed-tweet-format (error)
|
27
|
29
|
((item :initarg :item :reader item))
|
|
@@ -87,7 +89,7 @@ coleslaw:post and returns the tweet content.")
|
87
|
89
|
|
88
|
90
|
(defun tweet-new-post (file)
|
89
|
91
|
"Retrieve content matching FILE from in memory DB and publish it."
|
90
|
|
- (let ((post (coleslaw::find-content-by-path file)))
|
|
92
|
+ (let ((post (find-content-by-path file)))
|
91
|
93
|
(chirp:statuses/update (%format-post 0 post))))
|
92
|
94
|
|
93
|
95
|
(defun %format-post (offset post)
|