YappoLogs: App::Ikachan - 様々なサーバのバッチ処理の結果等を IRC のチャンネルに通知するサーバ ãã
ãªãã¸ããªã¯ãã¡ã akiym/p5-App-Tacochan - GitHub
HTTPã§å©ããSkypeã¿ãããªãã®ã§ããikachanãã³ãããã¦ä½ã£ãã®ã§ãããikachanã¨ã¯ä½¿ãåæãéãããããã¾ããã
使ãæ¹ã¯é常ã«ç°¡åã§ã
% tacochan starting httpd: http://127.0.0.1:4969/ at bin/tacochan line 182.
ã ãã§ãã(Skypeãç«ã¡ä¸ãã£ã¦ããå¿
è¦ãããã¾ã)
ããã©ã«ãã§ã¯http://localhost:4969/ã«http serverãç«ã¡ä¸ããã¾ãã(ikachanã¯http://localhost:4979ã§ãã)
ãªãã·ã§ã³ãé常ã«å°ãªãã¦ã·ã³ãã«ã§ãã
% tacochan -o http_host -p http_port
APIã®ä»æ§ãikachanã¨å°ãéã£ã¦ãã¦ã/noticeã/privmsgãããã¾ããããã®ä»£ããã«/sendã§ã¡ãã»ã¼ã¸ãéããã¨ãã§ãã¾ãã
詳ããå
容ã¯ãµã¼ãã¼ã«ãã©ã¦ã¶ã§ã¢ã¯ã»ã¹ããã¨ãã«è¡¨ç¤ºãããã®ã§ãããè¦ã¦ãã ããã
ã¾ããHTTPã§APIãå©ãã¨ãã«curlã使ã£ã¦ãããã®ã§ãããtacochan-clientã¨ãããã®ãç¨æããã®ã§ããã使ãã°ç°¡åã§ãã
#chatã«joinãã
% tacochan_client join #chat
ãã®#chatã¨ããã®ã¯ã"#t.akiym/$echo123;8d95e60b1199a802"ã®ãããªæååã®ãã¨ã§ããããã¯echo123ããã¨1対1ã§ãã£ãããããã¨ãã®idã§ããã
æ®æ®µãSkypeã使ã£ã¦ãã¦ãè¦ããã¨ã¯ãªãã¨æãã¾ãããªã®ã§ãecho123ã¨ãã£ããããããã¨ãã«ã¯æ¬¡ã®ããã«ããã¨ä¾¿å©ã§ãã
% tacochan_client join echo123 join success chat: #t.akiym/$echo123;8d95e60b1199a802
ã¦ã¼ã¶ã¼åã#chatã®ä»£ããã«å
¥ãã¦ããã¾ãããããã¦ããããã¨ã§èªåçã«idãä½ããã¾ãã
ããã¯ã«ã³ãã§åºåããã¨ã§è¤æ°å
¥ãããã¨ãã§ãã¾ãã
% tacochan_client join echo123,foo,bar join success chat: #t.akiym/$d0656290604bd99b
ãã®ããã«ããã°ãã°ã«ã¼ããã£ãããã§ãã¾ããã(ã°ã«ã¼ããã£ããã ã¨idãå°ãéãã®ããããã¨æãã¾ã)
#chatã«ã¡ãã»ã¼ã¸ãsendãã
% tacochan_client send #chat your_message
#chatã¯å ã»ã©ã®idã§ãã
% tacochan_client send #t.akiym/$echo123;8d95e60b1199a802 hello.
idããã¡ãã¡ã³ãããã¦ããã®ã¯é¢åãªã®ã§ãã¦ã¼ã¶ã¼åãå ¥ãããã¨ãã§ãã¾ãã
% tacochan_client send echo123 hello.
ããã§æ³¨æãã¦æ¬²ããã®ã¯ãè¤æ°ã®ã¦ã¼ã¶ã¼ãæå®ããã¨sendãããã³ã«æ°ãããã£ãããä½ããã¦ãã¾ããã¨ã§ããã¡ãªã¿ã«/joinãåãã§ãè¤æ°ã®ã¦ã¼ã¶ã¼ãæå®ãã¦ãä½åãjoinããã¨ãããããã£ãããã§ãã¦ãã¾ãã¾ãã
è¤æ°ã®ã¦ã¼ã¶ã¼ã«ã¡ãã»ã¼ã¸ãéãããå ´åã¯ã#chatãæå®ãã¦ãã ããã
#chatããleaveãã
% tacochan_client leave #chat
leaveãã¦ãã¾ãã¨ã»ã¨ãã©ã®å ´åre-joinã§ããªããªãã®ã§ãleaveã¯ä½¿ããªãã»ããããã§ããã¾ãã#chatã®ä»£ããã«ã¦ã¼ã¶ã¼åãå ¥ãããã¨ã¯ã§ãã¾ããã
以ä¸ã§ããã¨ã¦ãã·ã³ãã«ã§ããï¼