Skype ã® Rom å°ç¨ Bot ãä½ã£ã¦ã¿ã
é±ä¸ã®æ´æ°ç®æãã¦ããã«å¤¢ç ´ãã¾ãããæ ¹æ°è¯ãç¶ãã¦ããã¾ã(ããªã
ã¨äºãããã§ä»å㯠Skype API ããã°ã©ãã³ã°ããã¿ã«ãã¾ãã
å®ã¯ skyoe API èªä½ã¯çµæ§åã«è§¦ã£ã¦ãããããã§ããã
仲éå
㧠skype ãã£ãããã¦ããå
ã«åå¨ãæãåºãã¾ããã
API ã«ã¯ skype4py ã使ç¨ã
è¨èªã¯ python ã§ãã
ç°å¢ã®ç¨æãããã°ã©ãã³ã°ãå§ããåã®æºåçã¯ä»¥ä¸ã®è¨äºãåèã«ããã¦é ãã¾ããã
Skype4py ã®ä»æ§ã¯ä»¥ä¸ã®ãµã¤ããåèã«ãã¾ããã
ããããã°ã©ãã³ã°ãã¦ã¿ã㨠Bot ä½ãã®æ¥½ããã«æ²¡é ãã¦ãã¾ãä½è¨ãªãã®ãä½ã£ã¦ãã¾ãã¾ããã
ãã®ãã¡ã®ä¸åãããã§ãã
#!/usr/bin/python # coding: utf-8 import time import Skype4Py # respons to Skype def handler(msg, event): if event == u"RECEIVED": print msg.Datetime,'['+msg.FromDisplayName+']', msg.Body ## main programme to Skype bot def main(): skype = Skype4Py.Skype() skype.OnMessageStatus = handler skype.Attach() while True: time.sleep(1) if __name__ == '__main__': main()
å ã¿ã«å
ã
㯠Skype ã®ãã°ãåãããã¨ããåç®ã§å§ãããã®ã§ãå®å
¨ã«ç®çãããã¦ã¾ãã
ã§ãå¾æã¯ãã¦ãã¾ããã
表示ã¯ãããªé¢¨ã«ãªã£ã¦ã¾ãã
2011-01-30 22:10:36 [Skype Test Call] $USRNAME 2011.01.30 13:11:29 ãã¹ã
ã»ãã¨ã¯ç»åè²¼ãããã£ããã§ããã©ã
èªåãåä¿¡ããåã表示ããçºèº«å
ã®è²ã
ããã¬ã¡ãããããã®è¡¨ç¤ºã§ãã
ããå°å³ã§ããã©ã¤ãã¦æ¾ã£ã¦ããã¨ããããªäººã®çºè¨ãå
¥ã£ã¦ãã¦ãããããã§ããã
Twitter ã® TL çºãã¦ãæè¦ã«è¿ãã§ããçç£æ§ç ´å£ãããäºããã°ãã°ã
ãã°åå¾ç¨ã®ã¹ã¯ãªãããè¼ããããã¨æã£ã¦ããã§ããé·ããªã£ã¡ããã®ã§ä»åã¯ããã¾ã§ã
é¢ä¿ãªããã© Skype ãã·ã³æ¬²ããã§ãã