IRCbot Console


IRCbot ConsoleIRC






RSSIRC

IRC

IRC

HTTPIRC(HIP (HTTP IRC Proxy))


 

JavaScript(Rhino)使WEB使

Java

Tomcat使war使(Jetty使)


Java(JRE1.5)

JavaOS(Windows XPMac OS X)


URL

Latest Release onozaty/ircbot-console - GitHub


PircBotPircBotGNU General Public License v2.0


(ircbot_console-X.X.zip)

Windowsstart.batLinuxstart.sh

Tomcat使ircbot.war 
(Tomcat6Servlet API 2.5)

URLIRCbot Console(URL)

http://localhost:8080/ircbot/

トップ

Java(JRE1.5)

 Java  - Sun Microsystems


 .ircbot 

Java ircbot.home (-Dircbot.home="")

startup.bat
 
java -Dircbot.home="C:\ircbot" -classpath %IRCBOT_CLASSPATH% JettyRun ircbot.war

IRC


IRC

IRCOK

IRC"UTF-8""ISO-2022-JP"

接続情報設定

IRC


JOIN



チャンネル追加



チャンネル設定

RSS


RSS



RSS

RSS

JavaScript(Rhino)()

RSS設定

IRC(nullundefined)

URL
 
_title + " " + _link

RSSメッセージ


_channel チャンネル名を表す文字列。
_ircBot IRCボットオブジェクト。下記のクラスのpublicなメソッドを呼び出せます。
_title RSSエントリのタイトル
_link RSSエントリのリンク(URL)
_description RSSエントリの概要
_updatedDate RSSエントリの更新日時
_publishedDate RSSエントリの公開日時

周期スクリプト実行


JavaScript(Rhino)



周期スクリプト

()

周期スクリプト

(IRC)

周期スクリプト

IRC(nullundefined)

IRC
 
"おはようございます。"


_channel チャンネル名を表す文字列。
_ircBot IRCボットオブジェクト。下記のクラスのpublicなメソッドを呼び出せます。

_ircBot 使onozaty
 
_ircBot.sendMessage(
  "onozaty", // 送信先(nicknameまたはチャンネル名)
 『プライベートメッセージです。』// メッセージ
);

1JOIN

 
// チャンネルにJOINしているユーザ一覧を取得
var users = _ircBot.getUsers(_channel);

// 乱数を使って、ユーザを1人ピックアップ
var todayLeader = users[Math.floor(Math.random() * users.length)];

// メッセージ送信
todayLeader.getNick() + "さんが選ばれました。";

2WEB(Livedoor)

 
// livedoor Weather Web Service を使用
// (http://weather.livedoor.com/weather_hacks/webservice.html)
var text = readUrl('http://weather.livedoor.com/forecast/webservice/rest/v1?city=63&day=today');

// <?xml version=...?>のパースをサポートしていないので
// https://developer.mozilla.org/ja/E4X
text = text.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>\s*/, "");

// E4Xで参照
var xml = new XML(text);

// タイトルと天気をメッセージとして送信
_ircBot.sendMessage(_channel, xml.title);
_ircBot.sendMessage(_channel, xml.telop);


IRCJavaScript(Rhino)



メッセージ受信スクリプト

(IRC)

メッセージ受信スクリプト

IRC(nullundefined)


_channel チャンネル名を表す文字列。
_sender メッセージの送信者を表す文字列。
_message 送信メッセージ内容の文字列。
_ircBot IRCボットオブジェクト。下記のクラスのpublicなメソッドを呼び出せます。

"@ircbot" 
 
if (_message.indexOf('@ircbot') == 0) {
  // メッセージの先頭に@ircbotが含まれる場合
  _ircBot.sendMessage(
    _channel,
    _sender + 'さんの発言:' + _message
  );
}

1(XMLJSONWEB使)

 
var prefix = '@ircbot';

if (_message.indexOf(prefix) == 0) {
  var command = _message.substr(prefix.length).replace(/(^\s+)|(\s+$)/g, '');

  switch(command) {
    case '天気':
    case '今日の天気':
      showWeather('today');
      break;

    case '明日の天気':
      showWeather('tomorrow');
      break;

    case 'だれ?':
    case '誰?':
    case 'dare?':
      choiceUser();
      break;

    case '名言':
      showMeigen();
      break;
  }
}

function showWeather(day) {
  // livedoor Weather Web Service を使用
  // (http://weather.livedoor.com/weather_hacks/webservice.html)
  var text = readUrl('http://weather.livedoor.com/forecast/webservice/rest/v1?city=63&day=' + day);

  // <?xml version=...?>のパースをサポートしていないので
  // https://developer.mozilla.org/ja/E4X
  text = text.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>\s*/, "");

  // E4Xで参照
  var xml = new XML(text);

  // タイトルと天気をメッセージとして送信
  _ircBot.sendMessage(_channel, xml.title + ' : ' + xml.telop);
}

function choiceUser() {
  // チャンネルにJOINしているユーザ一覧を取得
  var users = _ircBot.getUsers(_channel);

  // 乱数を使って、ユーザを1人ピックアップ
  var todayLeader = users[Math.floor(Math.random() * users.length)];

  // メッセージ送信
  _ircBot.sendMessage(_channel, todayLeader.getNick() + 'さんに決まりました');
}

function showMeigen() {
  // 言霊.in を使用
  // (http://www.kotodama.in/)
  var text = readUrl('http://www.kotodama.in/api/quoteOfDay');
  var result = JSON.parse(text);

  // 名言を表示
  _ircBot.sendMessage(_channel, result.quote + ' by ' + result.author);
}

HTTP


HTTPIRC

HTTP

HTTPリクエストによるメッセージ送信

URL

http://localhost:8080/ircbot/talk

channelmessage(UTF-8)

#testURL

http://localhost:8080/ircbot/talk?channel=%23test&message=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%EF%BC%81




ログ

ログ


ver 1.6 (2013/02/02)  


 


ver 1.5 (2013/01/20)  

Apache HttpComponentsjar
 


ver 1.4 (2011/10/16)  


 


ver 1.3 (2011/06/11)  

RSSBASIC

RSSSSL(OK)
 


ver 1.2 (2010/11/03)  
RSS
 

ver 1.0 (2010/04/17)  

 


BlogContact