added signature support
This commit is contained in:
parent
bf38e75b1a
commit
9ed32f147c
2 changed files with 6 additions and 2 deletions
|
@ -35,7 +35,9 @@ the bot will post the timeline from the specified Twitter/Tumblr accounts and RS
|
||||||
"r/Clojure" "https://www.reddit.com/r/clojure/.rss"}
|
"r/Clojure" "https://www.reddit.com/r/clojure/.rss"}
|
||||||
:mastodon {:access_token "XXXX"
|
:mastodon {:access_token "XXXX"
|
||||||
:api_url "https://botsin.space/api/v1/"
|
:api_url "https://botsin.space/api/v1/"
|
||||||
:max-post-length 300}}
|
:max-post-length 300
|
||||||
|
;; optional signature for posts
|
||||||
|
:signature "#newsbot"}}
|
||||||
```
|
```
|
||||||
|
|
||||||
* the bot looks for `config.edn` at its relative path by default, an alternative location can be specified either using the `MASTODON_BOT_CONFIG` environment variable or passing the path to config as an argument
|
* the bot looks for `config.edn` at its relative path by default, an alternative location can be specified either using the `MASTODON_BOT_CONFIG` environment variable or passing the path to config as an argument
|
||||||
|
|
|
@ -49,7 +49,9 @@
|
||||||
(post-status status-text nil))
|
(post-status status-text nil))
|
||||||
([status-text media-ids]
|
([status-text media-ids]
|
||||||
(.post mastodon-client "statuses"
|
(.post mastodon-client "statuses"
|
||||||
(clj->js (merge {:status status-text}
|
(clj->js (merge {:status (if-let [signature (-> config :mastodon :signature)]
|
||||||
|
(str status-text "\n" signature)
|
||||||
|
status-text)}
|
||||||
(when media-ids {:media_ids media-ids}))))))
|
(when media-ids {:media_ids media-ids}))))))
|
||||||
|
|
||||||
(defn post-image [image-stream description callback]
|
(defn post-image [image-stream description callback]
|
||||||
|
|
Reference in a new issue