For brevity, this section will only cover retrieving the username, screen name, date, and text of the search results. Please refer to the documentation of the twitter4j library for more information. The documentation page for the QueryResult
class is located at http://twitter4j.org/oldjavadocs/3.0.3/twitter4j/QueryResult.html.
The search capabilities should go in their own namespace, so you'll need to create a new file at tdsl/src/tdsl/search.clj
. The namespace of this file should use two dynamic variables from the tdsl.core
namespace, namely *twitter*
and *tweets*
. The namespace also needs to import the Query
class from the twitter4j Java library. If done correctly, the beginning of the file should be similar to the REPL session shown as follows:
tdsl.core> (ns tdsl.search (:use [tdsl.core :only [*twitter* *tweets*]]) (:import [twitter4j Query])) nil tdsl.search...