Skip to content

Instantly share code, notes, and snippets.

@nahi
Created December 6, 2010 14:32
Show Gist options
  • Save nahi/730361 to your computer and use it in GitHub Desktop.
Save nahi/730361 to your computer and use it in GitHub Desktop.
My first Twitter4J example (for JRuby)
require 'java'
require 'twitter4j-core-2.1.8-SNAPSHOT.jar'
include_class 'twitter4j.TwitterFactory'
include_class 'twitter4j.http.AccessToken'
ck = "XXX"
cs = "XXX"
ak = "XXX"
as = "XXX"
client = TwitterFactory.new.get_oauth_authorized_instance(ck, cs, AccessToken.new(ak, as))
tweets = client.home_timeline
tweets.each do |tweet|
p tweet.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment