Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (24 sloc) 0.68 kB
#!/usr/bin/env ruby
#
# reinjector.rb -- pulls tweets from the iteration one database and
# puts them into the queue for processing
#
# Part of the twootr! "project", hosted on github:
# http://github.com/bleything/twootr
#
# Copyright (c) 2010, Ben Bleything
# Released under the MIT License
#
$stdout.sync = true
require 'rubygems'
require 'sequel'
require 'resque'
require 'resque_jobs/reinject'
puts "Connecting to database..."
DB = Sequel.connect( "postgres://localhost" )[:twoots]
LIMIT = 2500
offset = 0
while ids = DB.order( :id ).limit( LIMIT, offset ).map( :id )
ids.each {|id| Resque.enqueue Reinject, id }
print "#{offset += LIMIT}..."
end
Jump to Line
Something went wrong with that request. Please try again.