sstrigler / twitterspy forked from dustin/twitterspy

A twitter <-> XMPP gateway with search and track and other good stuff.

This URL has Read+Write access

Stefan Strigler (author)
Wed Dec 10 02:24:16 -0800 2008
commit  9a6ffade68263314bd3f355d4d5847b2943bcabb
tree    c95f2001fe6416946880cc51160501de7cff54ab
parent  ad7c072c853a82babe872593bd50a4a21e6f5590
twitterspy / twitterspy.rb
100755 41 lines (35 sloc) 1.05 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env ruby
 
require 'rubygems'
require 'sqlite3'
require 'date'
require 'summize'
require 'htmlentities'
 
require 'twitterspy/config'
require 'twitterspy/models'
require 'twitterspy/commands'
require 'twitterspy/threading'
require 'twitterspy/delivery_helper'
require 'twitterspy/main'
 
TwitterSpy::Config::CONF['general'].fetch('nthreads', 1).to_i.times do |t|
  puts "Starting general thread #{t}"
  TwitterSpy::Threading.start_worker TwitterSpy::Threading::IN_QUEUE
end
TwitterSpy::Config::CONF['general'].fetch('twitrthreads', 1).to_i.times do |t|
  puts "Starting twitter read thread #{t}"
  TwitterSpy::Threading.start_worker TwitterSpy::Threading::TWIT_R_QUEUE
end
TwitterSpy::Config::CONF['general'].fetch('twitwthreads', 1).to_i.times do |t|
  puts "Starting twitter write thread #{t}"
  TwitterSpy::Threading.start_worker TwitterSpy::Threading::TWIT_W_QUEUE
end
 
def inner_loop(main)
  loop do
    main.run_loop
  end
end
 
loop do
  puts "Connecting..."
  $stdout.flush
  # Jabber::debug=true
  inner_loop TwitterSpy::Main.new
end