BitlBeeはインスタントメッセンジャーとIRCのゲートウェイサーバーです。 これを利用するとMSNメッセンジャーなどのインスタントメッセンジャーとTwitterやFacebookチャットをIRCクライアント一つで利用できるのでウハウハじゃね?ということで試してみた記録。
Debianなのでこれだけ。
# aptitude install bitlbee
ローカルで利用する限りは特にありません。 インターネットに向けてサービスを提供するのであれば /etc/bitlbee/bitlbee.conf を変更する必要がありますがローカルで利用するだけなら、特にイジル必要もなく、接続ポートを変えるのであれば(デフォルトでは6667)、dpkg-reconfigure bitlbeeとするぐらいです。
Xchatを起動すると出てくる「Xchat: ネットワーク一覧」ウィンドウのネットワークに[追加]ボタンを押してネットワークを追加します。 ネットワーク名はなんでもかまいませんが、ここではわかりやすくbitlbeeとしました。 追加したら[編集]ボタンを押してサーバーを追加します。
サーバーの追加方法は「<ネットワーク名>のサーバー」の[追加]ボタンを押すとサーバー欄にnewserver/6667と追加されるので、newserverの部分をlocalhostに変更するだけです。あと文字集合を「ISO-2022-JP(Japanese)」に変更しておきましょう。 UTF-8のままでかまいません。
設定が終わばサーバーの設定ウィンドウを閉じてbitlbeeに接続してください。
操作はコマンドだけですが「help」と入力すれば簡単な英語だけど説明が出るし、「help commands」とすればコマンドの一覧も出てくるので大丈夫だと思います。
まず自分のnickのパスワードを設定します。 パスワードを設定するとアカウント設定を保存できます。
register <パスワード>
「help register」にも書いてありますが、パスワードが平文が流れるので気をつけてください。ローカルで利用するだけなら問題ありませんが念のため。 パスワードを設定しなおす場合は「set password <パスワード>」コマンドを使います。
charsetがiso8859-1になっているのでiso-2022-jpに変更します。 「set」で設定の一覧が出てきます。
<nogajun> set <root> away_devoice = `true' <root> auto_connect = `true' <root> auto_reconnect = `false' <root> auto_reconnect_delay = `300' <root> buddy_sendbuffer = `false' <root> buddy_sendbuffer_delay = `200' <root> charset = `iso8859-1' <root> debug = `false' <root> default_target = `root' <root> display_namechanges = `false' <root> handle_unknown = `root' <root> lcnicks = `true' <root> ops = `both' <root> private = `true' <root> query_order = `lifo' <root> save_on_quit = `true' <root> strip_html = `true' <root> to_char = `: ' <root> typing_notice = `false'
「set charset iso-2022-jp」と入力します。
<nogajun> set charset iso-2022-jp <root> charset = `iso-2022-jp'
アカウントを登録しないと始まらないのでアカウントを登録します。
User Guideによると「account add <protocol> <username> <password> [<server>].」で登録できるそうなのでこんな感じ。
MSNメッセンジャー | account add msn <アカウント@hotmail.com> <パスワード> |
---|---|
Google Talk | account add jabber <アカウント@gmail.com> <パスワード> talk.google.com:5223:ssl |
Yahoo!メッセンジャー | account add yahoo <アカウント> <パスワード> cs.yahoo.co.jp |
ICQ | account add oscar <UIN> <パスワード> |
Yahoo!とICQはアカウントあったと思うけど忘れて確認できていないので、こんな感じということで。
登録の様子はこんな感じ。
<nogajun> account add msn <アカウント@hotmail.com> <パスワード> <root> Account successfully added <nogajun> account add jabber <アカウント@gmail.com> <パスワード> talk.google.com:5223:ssl <root> Account successfully added
確認するには「account list」と入力します。
<nogajun> account list <root> 0. MSN, <アカウント名>@hotmail.com <root> 1. JABBER, <アカウント名>@gmail.com <root> End of account list
これでアカウント登録できたのでアカウントを有効にします。
account on 0 account on 1
これでおっけー。念のため「save」コマンドで設定を保存します。
save
Twitter側の仕様変更でtwitterゲートウェイとしては使えなくなっていました が、Bitlbeeがtwitterに対応して使えるようになりました。
アカウントの登録は他のIMと同じになりました。
Twitteraccount add twitter <アカウント名> <パスワード>
実際の登録の様子はこんな感じ。
<nogajun> account add twitter <アカウント名> <パスワード> <root> Account successfully added <nogajun> account list <root> 0 (twitter): twitter, <アカウント名> <root> End of account list <nogajun> account twitter on * twitter_nogajun (twitter_nogajun@twitter) は &bitlbee へ参加しました。 * localhost gives voice to twitter_nogajun <root> twitter - Logging in: Connecting <root> twitter - Logging in: Requesting OAuth request token
ログインが成功するとOAuth認証のためのアドレス https://api.twitter.com/oauth/authorize?oauth_token=(略) が表示されるのでアクセスします。
* Loaded log from Wed Dec 29 00:01:34 2010 <twitter_nogajun> To finish OAuth authentication, please visit https://api.twitter.com/oauth/authorize?oauth_token=(略) and respond with the resulting PIN code.
OAuth認証の許可を出すと7桁のPINコードが表示されます。PINコードをコピーしてクライアントに入力します。
<nogajun> xxxxxxx
PINコードを入力して問題がなければtwitterアカウントのチャンネルに入ります。
* 今 #twitter_nogajun で会話中です。 --- localhost はモードを +t #twitter_nogajun に設定しました。 * Topic for #twitter_nogajun is: BitlBee groupchat: "home/timeline". Please keep in mind that root-commands won't work here. Have fun! * Topic for #twitter_nogajun set by root!root@localhost at Wed Dec 29 00:46:28 2010
<nogajun> help set auto_reply_timeout <root> Type: integer <root> Scope: account <root> Default: 10800 <root> <root> For Twitter accounts: If you respond to Tweets IRC-style (like "nickname: reply"), this will automatically be converted to the usual Twitter format ("@screenname reply"). <root> <root> By default, BitlBee will then also add a reference to that person's most recent Tweet, unless that message is older than the value of this setting in seconds. <root> <root> If you want to disable this feature, just set this to 0. Alternatively, if you want to write a message once that is not a reply, use the Twitter reply syntax (@screenname).
<nogajun> help set commands <root> Type: boolean <root> Scope: account <root> Default: true <root> <root> With this setting enabled, you can use some commands in your Twitter channel/query. The commands are simple and not documented in too much detail: <root> <root> undo [<id>] - Delete your last Tweet (or one with the given ID) <root> rt <screenname|id> - Retweet someone's last Tweet (or one with the given ID) <root> follow <screenname> - Start following a person <root> unfollow <screenname> - Stop following a person <root> post <message> - Post a tweet <root> <root> Anything that doesn't look like a command will be treated as a tweet. Watch out for typos! :-)
Bitlbeeの接続を切断するとアカウント設定は消えます。 ですがsaveコマンドで設定を保存していると「identify」コマンドで呼び出すことができます。
identify <パスワード>
パスワードは最初にregisterコマンドで登録したパスワードを使います。