Created
January 12, 2011 07:35
-
-
Save anonymous/775816 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import '(twitter4j Query | |
QueryResult | |
Tweet | |
TwitterException | |
TwitterFactory) | |
'(twitter4j.http AccessToken | |
RequestToken) | |
'(java.util List | |
Properties)) | |
(defn search-tweet [query] | |
(let [twitter (.getInstance (TwitterFactory.))] | |
(try | |
(def result (. twitter search (Query. query))) | |
(for [tweet (.getTweets result)] | |
(println "@" (.getFromUser tweet) " - " (.getText tweet))) | |
(catch TwitterException te (println "Failed to search tweets: " (.getMessage te)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment