Skip to content

Commit

Permalink
Pull in twitter4j client and prepare wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunsch committed Jul 29, 2016
1 parent c11a66e commit 232ff32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion project.clj
Expand Up @@ -6,7 +6,8 @@
[overtone "0.9.1"]
[amazonica "0.3.55"]
[clj-http "2.1.0"]
[com.taoensso/timbre "4.3.1"]]
[com.taoensso/timbre "4.3.1"]
[org.twitter4j/twitter4j-core "4.0.4"]]
:main ^:skip-aot sonic-sketches.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
16 changes: 16 additions & 0 deletions src/sonic_sketches/twitter.clj
@@ -0,0 +1,16 @@
(ns sonic-sketches.twitter
"Utilities for uploading a song to Twitter"
(:use [clojure.java.shell :only [sh]])
(:import [twitter4j TwitterFactory StatusUpdate GeoLocation]))

(defonce client (TwitterFactory/getSingleton))

(defn wav->mp4
[path]
(let [out "test.mp4"]
(sh "ffmpeg" "-i" path "-strict" "experimental" out)))

(defn tweet
"Tweet the song from a path"
[path metadata]
(.updateStatus client "Hello, world."))

0 comments on commit 232ff32

Please sign in to comment.