A basic clojure wrapper for twitter4j APIs.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
resources
src/gezwitscher
test/gezwitscher
.gitignore
LICENSE
README.md
project.clj

README.md

Gezwitscher

A basic wrapper around the java twitter4j framework for the Twitter API. gezwitscher only supports status/filter stream from the Streaming API. Furthermore search, user timeline and update status APIs are provided by the REST and POST API.

Authentification is required. Refer to the documentation for aquiring the credentials.

A a simple slightly outdated collector using articles published on Twitter ceres is using this library. There is also twitter-collector feeding tweets into replikativ.

Usage

To include gezwitscher in your project, add the following to your project.clj dependencies:

Clojars Project

Punch in the API keys generated by twitter. You should find them in your twitter application management. Tip: Do not copy your keys in any form in your code otherwise your application could be compromised if you build an open source application. Set them for example in your environment variables or read them from a local configuration file.

(ns example.core
  (:require [gezwitscher.core :refer [stream]]))

;; the credentials should be specified as follows
(def creds
  {:consumer-key "****" 
   :consumer-secret "****"
   :access-token "****"
   :access-token-secret "****"})

(def close-stream-fn
      (stream
       credentials
       [123456 & twitter-ids-to-follow]
       ["topic1" "ecology" "politics" "arduino"]
       (fn [new-tweet] (println new-tweet))
       (fn [e] (println e))))

License

Copyright © 2014-2015 Konrad Kühne, 2016 Christian Weilbach

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.