Geo-tag tweets.

This commit is contained in:
John Wiseman 2019-12-20 21:31:49 -08:00
parent 5e70b3233b
commit 19ca5c4735

View File

@ -35,13 +35,17 @@
;; Posts a tweet with optional multiple media. Returns a promise that
;; 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))
(fn [media-ids]
(log-info "Tweeting status:'%s' with media: %s" status media-ids)
(p/let [result (.post twit "statuses/update"
(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)]
(log-info "Tweet posted")
(log-info "Tweet posted: %s" result)
result))))