16
JJUG 2009 ( 秋 ) [email protected]

Jjug2009 Fall

Embed Size (px)

Citation preview

自己紹介

•たーちゃん•id:tarchan

•@tarchan

•java-jaでは「なるとの人」、「なるとブレイク」と呼ばれています。

発表内容

•Javaと、 IRCと、 jQueryなアプリ

IRCを受信

•ConfigPit

•IRCKit

設定を取得

•Preferences config = ConfigPit.load("freenode.net");

•String id = config.get(“id”, “”);

•otsuneさんの「 Config::Pit使え」にインスパイアされました。

IRCに接続

•irc = new IRCClient().addAllHandlers(this);

•irc.setProperty("irc.channel", channel);

•irc.open(host, port);

メッセージを受信

•アノテーションでメソッドを指定します。

•@Reply("PRIVMSG")

•public void onMessage(IRCMessage message)

ボタンをクリック

•ActionQueryを使用します。

•JavaScriptの jQueryにインスパイアされました。

ActionQuery

•ActionQuery.ready(window).button().click(this);

•ウインドウ上のボタンをクリックしたらメソッドを実行します。

JMenuItem

•ActionQuery.ready(window).find(AbstractButton.class).click(Object target, String action, String property);

•JMenuItemも AbstractButtonです。

•メニューも実行できます。

Twitterに送信

•ConfigPit

•Twitter4J

ConfigPit再登場

•Preferences config = ConfigPit.load("twitter.com");

•String id = config.get(“id”, “”);

•みんなが同じ方式を使うと便利ですね。

Twitter4J

•Twitter twitter = new Twitter(id, password);

•twitter.sendDirectMessage(id, message);

•自分宛にダイレクトメッセージを送ります。

ソースコード

•CodeRepos

•はてなダイアリー

ご清聴ありがとうございました。