This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 20 lines (15 sloc) 304 Bytes
#!/usr/bin/env ruby
require 'rubygems'
require 'mongo'
require 'json'
mongo = Mongo::Connection.new
mongo.drop_database 'tweets'
db = mongo.db 'tweets'
col = db['tweets']
STDIN.each do |line|
begin
col.insert JSON::parse(line)
rescue Exception => e
STDERR.puts "line #{line} failed?"
end
end