Geo-tag tweets.
This commit is contained in:
parent
5e70b3233b
commit
19ca5c4735
@ -35,13 +35,17 @@
|
|||||||
;; Posts a tweet with optional multiple media. Returns a promise that
|
;; Posts a tweet with optional multiple media. Returns a promise that
|
||||||
;; resolves to the response result.
|
;; resolves to the response result.
|
||||||
|
|
||||||
(defn tweet [twit status image-paths]
|
(defn tweet [twit status image-paths lat long]
|
||||||
(p/then (p/all (map #(upload-image twit %) image-paths))
|
(p/then (p/all (map #(upload-image twit %) image-paths))
|
||||||
(fn [media-ids]
|
(fn [media-ids]
|
||||||
(log-info "Tweeting status:'%s' with media: %s" status media-ids)
|
(log-info "Tweeting status:'%s' with media: %s" status media-ids)
|
||||||
(p/let [result (.post twit "statuses/update"
|
(p/let [result (.post twit "statuses/update"
|
||||||
(clj->js {:status status
|
(clj->js {:status status
|
||||||
:media_ids [media-ids]}))
|
:media_ids [media-ids]
|
||||||
|
:lat lat
|
||||||
|
:long long
|
||||||
|
:display_coordinates true
|
||||||
|
}))
|
||||||
result (js->clj result :keywordize-keys true)]
|
result (js->clj result :keywordize-keys true)]
|
||||||
(log-info "Tweet posted")
|
(log-info "Tweet posted: %s" result)
|
||||||
result))))
|
result))))
|
||||||
|
Loading…
Reference in New Issue
Block a user