Skip to content

Commit

Permalink
Added logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
quephird committed May 29, 2021
1 parent db5a39b commit 18e4026
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/clojure/nail_polish_bot/twitter.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
; TODO: Need logging
(defn post-status-with-media
[status filename]
(let [env-vars (map env/env [:app-consumer-key
:app-consumer-secret
:user-access-token
:user-access-token-secret])
bot-creds (apply oauth/make-oauth-creds env-vars)]
(let [env-vars (map env/env [:app-consumer-key
:app-consumer-secret
:user-access-token
:user-access-token-secret])
bot-creds (apply oauth/make-oauth-creds env-vars)
new-file (req/file-body-part filename)
new-status (req/status-body-part status)
body [new-file new-status]
api-params {:oauth-creds bot-creds
:body body}
response (apply api/statuses-update-with-media api-params)]
; TODO: Need to check env-vars to see that it actually has something
(api/statuses-update-with-media :oauth-creds bot-creds
:body [(req/file-body-part filename)
(req/status-body-part status)])))
(println response)))

0 comments on commit 18e4026

Please sign in to comment.