From 19ca5c4735c7c0f70bfb3ccb1451060115a077cf Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Fri, 20 Dec 2019 21:31:49 -0800 Subject: [PATCH] Geo-tag tweets. --- src/main/lemondronor/circlebot/twitter.cljs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/lemondronor/circlebot/twitter.cljs b/src/main/lemondronor/circlebot/twitter.cljs index 6dab93a..9b9e6e2 100644 --- a/src/main/lemondronor/circlebot/twitter.cljs +++ b/src/main/lemondronor/circlebot/twitter.cljs @@ -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))))