#!/usr/bin/env ruby
# vim:fileencoding=UTF-8:
$KCODE = "u" if RUBY_VERSION < "1.9" # json use this
=begin
# tig.rb
Ruby version of TwitterIrcGateway
## Launch
$ ruby tig.rb
If you want to help:
$ ruby tig.rb --help
## Configuration
Options specified by after IRC realname.
Configuration example for Tiarra .
general {
server-in-encoding: utf8
server-out-encoding: utf8
client-in-encoding: utf8
client-out-encoding: utf8
}
networks {
name: tig
}
tig {
server: localhost 16668
password: password on Twitter
# Recommended
name: username mentions tid
# Same as TwitterIrcGateway.exe.config.sample
# (90, 360 and 300 seconds)
#name: username dm ratio=4:1 maxlimit=50
#name: username dm ratio=20:5:6 maxlimit=62 mentions
#
#
# (60, 360 and 150 seconds)
#name: username dm ratio=30:5:12 maxlimit=94 mentions
#
#
# (36, 360 and 150 seconds)
#name: username dm ratio=50:5:12 maxlimit=134 mentions
#
# for Jabber
#name: username jabber=username@example.com:jabberpasswd
}
### athack
If `athack` client option specified,
all nick in join message is leading with @.
So if you complemente nicks (e.g. Irssi),
it's good for Twitter like reply command (@nick).
In this case, you will see torrent of join messages after connected,
because NAMES list can't send @ leading nick (it interpreted op.)
### tid[=[,]]
Apply ID to each message for make favorites by CTCP ACTION.
/me fav [ID...]
and can be
0 => white
1 => black
2 => blue navy
3 => green
4 => red
5 => brown maroon
6 => purple
7 => orange olive
8 => yellow
9 => lightgreen lime
10 => teal
11 => lightcyan cyan aqua
12 => lightblue royal
13 => pink lightpurple fuchsia
14 => grey
15 => lightgrey silver
### jabber=:
If `jabber=:` option specified,
use Jabber to get friends timeline.
You must setup im notifing settings in the site and
install "xmpp4r-simple" gem.
$ sudo gem install xmpp4r-simple
Be careful for managing password.
### alwaysim
Use IM instead of any APIs (e.g. post)
### ratio=:[:]
"121:6:20" by default.
/me ratios
Ratio | Timeline | DM | Mentions |
---------+----------+-------+----------|
1 | 24s | N/A | N/A |
141:6 | 26s | 10m OR N/A |
135:12 | 27s | 5m OR N/A |
135:6:6 | 27s | 10m | 10m |
---------+----------+-------+----------|
121:6:20 | 30s | 10m | 3m |
---------+----------+-------+----------|
4:1 | 31s | 2m1s | N/A |
50:5:12 | 49s | 8m12s | 3m25s |
20:5:6 | 57s | 3m48s | 3m10s |
30:5:12 | 58s | 5m45s | 2m24s |
1:1:1 | 1m13s | 1m13s | 1m13s |
---------------------------------------+
(Hourly limit: 150)
### dm[=]
### mentions[=]
### maxlimit=
### clientspoofing
### httpproxy=[[:]@][:]
### main_channel=
### api_source=