Skip to content

Instantly share code, notes, and snippets.

@muddana
Created March 15, 2010 22:16
Show Gist options
  • Save muddana/333398 to your computer and use it in GitHub Desktop.
Save muddana/333398 to your computer and use it in GitHub Desktop.
twitter streaming script
require 'rubygems'
require 'mongo'
require 'tweetstream'
USER = "<username>"
PASS = "<password>"
conn = Mongo::Connection.new
db = conn.db("dbname")
tweets = db.collection("collname")
TweetStream::Client.new(USER,PASS).sample do |status|
tweets.insert(status)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment