Skip to content

Instantly share code, notes, and snippets.

@tnaka
Forked from naoto/1.README.mkd
Created May 23, 2010 12:46
Show Gist options
  • Save tnaka/410906 to your computer and use it in GitHub Desktop.
Save tnaka/410906 to your computer and use it in GitHub Desktop.
TwitterIrcGateway で自分と同じ ScreenName を持つ tweet の BroadcastUpdate を中止する DLR

他クライアントからのtweetが全てのチャンネルに表示されて困っている人向け。 ドロップされるべきtweetもチャンネル#Twitterには表示するようにした。 UserStream使ってる人で、topicをtweetにしている場合、topicの更新が二度になってしまうかも。

TwitterIRCGateway

  1. Twitter に UserStream 機能が搭載されたことにより TwitterIRCGateway にも UserStream AddIn が作られました. 2. しかし,現状では BroadcastUpdate を false にしてもすべてのチャンネルにエコーされてしまいます.
  2. それを回避する為に self_drop.rb を書きました.

Usage

  1. $TIG_PATH/Configs/$USER/Scripts を作成する.
  2. そこに self_drop.rb を配置
  3. IRC Client 等から #Console につなぎ DLR コンテキストに入る
  4. そこで reload を行う

以上で, BroadcastUpdate が false となる

Session.pre_send_message_timeline_status do |sender,e|
if e.status.user.ScreenName.to_s == sender.TwitterUser.ScreenName.to_s
Session.send_channel_message(e.status.text)
e.cancel = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment