As an example, this morning I noticed an old Twitter direct message from the author of Nozzle library asking me if I had a chance to try it. Instead of setting up a separate Leiningen project directory, I just did a cljr install com.ashafa/nozzle 0.2.1, went to my catch-all directory where I keep short snippets of Clojure code, and entered Tunde's test program for Nozzle:
;; assumes: cljr install com.ashafa/nozzle 0.2.1 (use 'com.ashafa.nozzle) (def username (System/getenv "TWITTER_ACCOUNT")) (def passwd (System/getenv "TWITTER_PASSWD")) (defn my-callback [message] (println message)) (def noz (create-nozzle "filter" username passwd my-callback {:track "twitter"}))and running it is as simple as:
cljr run nozzle-twitter-test.cljor, using swank and Emacs:
cljr swankand in Emacs do M-x slime-connect and in the repl: (load "nozzle-twitter-test")
No comments:
Post a Comment