ã¿ã¼ããã«ããSkype -- Skysh
æè¿ã¿ã¼ããã«ããSkypeãããããªã¼ã¨æããã¨ãããããã¾ãããæ¤ç´¢ãã¦ã¿ãã¨ããã¤ãã¿ã¼ããã«ããSkypeãå®è¡ãããã®ãè¦ã¤ããã¾ããããã¾ãã¡èªåã«åããã®ããªãã£ãã®ã§ãSkype4Pyã¨ããSkypeAPIã®Pythonã©ããã¼ã使ã£ã¦ãã¿ã¼ããã«ããSkypeãåºæ¥ãSkyshã¨ãããã®ãä½ãã¾ãããMac OS Xã§ããåä½ç¢ºèªãã¦ãªãã§ãã,Skype4Pyã¨Pythonã使ããç°å¢ãªã使ããã¨æãã¾ã(ansi colorã使ã£ã¦ãã®ã§windowsã ã¨å³ããããããã¾ãããâ¦,ã£ã¦ãããreadlineã使ããªãã?)ã
ãã¦ã³ãã¼ã
ã½ã¼ã¹ã¯githubã«ããã¾ãã
ã»GitHub - mmisono/Skysh: Skype in Terminal
å¿
è¦ãªç©:
ã»Skype4Py
ã»termcolor
以ä¸ã®2ã¤ã¯ãã¦ã³ãã¼ããã¦ã % python setup.py install ã¨ããã°ã¤ã³ã¹ãã¼ã«ããã¾ããã¾ããSkypeAPIã¯ããã¾ã§ãèµ·åä¸ã®Skypeã¯ã©ã¤ã¢ã³ãã«å¯¾ãã¦æä½ããããªãã®ã§Skypeã®èµ·åãå¿
è¦ã§ãã
å®éã«ã¯Skype4Pyã«ã¯Skypeãèµ·åãããæ©è½ãããã¾ããããããMac OS Xã§å®è¡ããã¨ã¨ã©ã¼ã«ãªãã¾ããããã¯æ¢ç¥ã®åé¡ã®ããã§(http://forum.skype.com/topic/357681-skype4py-runtimeerror-with-patch/)ããããã¯ç´ãããããã¾ããã
(2010/4/10 追è¨)
ä¸ã®ãã©ã¼ã©ã ã®æå¾ã«æ¸ãã¦ããã¨ããã
--- Skype4Py.orig/api/darwin.py 2009-09-25 06:13:41.000000000 -0400 +++ Skype4Py/api/darwin.py 2010-03-20 18:19:18.000000000 -0400 @@ -297,6 +297,7 @@ self.center = CFDistributedNotificationCenter() self.is_available = False self.client_id = -1 + self.thread_started = False def run(self): self.logger.info('thread started') @@ -363,6 +364,16 @@ time.sleep(1.0) return self.is_available + def start(self): + """ + Start the thread associated with this API object. + Ensure that the call is made no more than once, + to avoid raising a RuntimeError. + """ + if not self.thread_started: + super(SkypeAPI, self).start() + self.thread_started = True + def startup(self, minimized, nosplash): if not self.is_running(): from subprocess import Popen
ã¨ãã¦ãskyshã®éçºçã«ããã¨(ãªããã¨ã©ã¼ãåºã¦ãã¾ãã¾ãã)ä¸å¿skyshå®è¡æã«Skypeãèµ·åãã¦ãªããã°èµ·åã§ããããã«ãªãã¾ããã
å®è¡æ¹æ³
% python skysh.py
ã§å®è¡ã§ãã¾ãã
ããã³ããã«ã¯ã(éå§ãã¦ããã°)ç¾å¨ã®ãã£ããåãèªåã®ã¦ã¼ã¶ã¼åã表示ããã¾ãã
使ãæ¹
åºæ¬çã«å ¥åã¯ãã£ããã¡ãã»ã¼ã¸ã¨ãã¦éä¿¡ããã¾ãããããã以ä¸ã®å ¥åã¯ã³ãã³ãã¨ãã¦å¦çããã¾ããã³ãã³ãã¯ã¿ãã§è£å®ãã§ãã¾ãã
add
bookmark ç¾å¨ã®ãã£ãããããã¯ãã¼ã¯ãã¾ãã
bookmarks ããã¯ãã¼ã¯ã®ä¸è¦§ã表示ããæå®ãããã£ããã«åãæ¿ãã¾ãã
chat
exit çµäºãã¾ãã
friends ã³ã³ã¿ã¯ããªã¹ãã®ã¡ã³ãã¼ã表示ãã¾ãã
kick
ls ã¢ã¯ãã£ããã£ããã®ä¸è¦§ã表示ãã¾ãã
members ç¾å¨ã®ãã£ããã®ã¡ã³ãã¼ã表示ãã¾ãã
mood [Message] ã ã¼ãããã¹ãã表示ããããæå®ãããã¡ãã»ã¼ã¸ã«å¤æ´ãã¾ãã
open æè¿ã®ãã£ããã¡ãã»ã¼ã¸ã®ä¸ã®URLã表示ããæå®ãããURLãéãã¾ãã
profile
recent æè¿ã®ãã£ããä¸è¦§ã表示ããæå®ãããã£ããã«åãæ¿ãã¾ãã
search
status ç¾å¨ã®ã¹ãã¼ã¿ã¹ã®è¡¨ç¤ºã¨å¤æ´ããã¾ãã
unbookmark ç¾å¨ã®ãã£ãããã¢ã³ããã¯ãã¼ã¯ãã¾ãã
ãã¨helpã§ãã®ã¡ãã»ã¼ã¸ã表示ããã¾ãã
ã¨ãããã主ãªä½¿ããã㯠chat hoge ã¨ãã¦hogeã¨ãã£ããããããããã¨ã ã¨æãã¾ãããã ãããã¾ã«ãã®chatã³ãã³ããä¸æããããªããã¨ãããã¾ãã
å人çã«ã¯ãrecent ã§æè¿ã®ãã£ããã®ä¸è¦§ã表示ããã¦ãããããã£ãããåãæ¿ããã®ãããã¨æãã¾ãã
注æç¹
Skype4Pyã®åé¡ãªã®ãã©ããã¯åããã¾ãããããã¤ãã®ã³ãã³ãã¯æ£ããåä½ããä¾å¤ãçºçãã¾ãã
ã»ls
lsã³ãã³ãã¯ãå®éã«ã¯Skype4Pyã®ActiveChatsã¨ãããã®ã®ä¸è¦§ã表示ãã¾ããèªåã¯ActiveChats = ç¾å¨ãã£ããã¦ã£ã³ãã¦ã§éãã¦ãããã£ãã ã ã¨æã£ã¦ããã®ã§ããããã®ActiveChatsãåç
§ãããã¨ããã¨ã¨ã©ã¼ã«ãªãã¾ããã¨ãããã¨ã§ãã®ã³ãã³ãã¯ç¾å¨ä½¿ããªãããã§ã(ä¾å¤ãæç²ãã¦ä½ããã¾ãã)ã
(2010/4/11 追è¨)
v0.0.3ã«ã¦lsãããã°ã¡ããã¨ç¾å¨ãã£ããã¦ã£ã³ãã¦ã«ãããã£ããä¸è¦§ã表示ããåãæ¿ããããããã«ãªãã¾ããã
...以ä¸æè¡çãªè©±
ãããããã£ããã¦ã£ã³ãã¦ã«ããã¤ãã£ããããã£ã¦ãActiveChats.Countã1ãªã®ã¯ãããããªã¨æã£ã¦ãã¾ãããããããã調ã¹ã¦ã¿ãã¨ActiveChats.Nameã«å
¨ã¦ã®ãã£ããåãå«ã¾ãã¦ããã¨ãåããã¾ãããã©ãèãã¦ããã°ã ã¨æãã¾ã(ããããã¦Macã ã?)ããActiveChats.Name.split(' ')ã¨ããã°ã¢ã¯ãã£ããã£ããã®ååã®ãªã¹ããåå¾ã§ãã¾ããSkype4Py.skypeã¤ã³ã¹ã¿ã³ã¹ã«ã¯Chat(Name)ã¡ã½ãããããã®ã§ãself.skype.Chat(ActiveChats.Name.split(' ')[0])ã¨ãããã°ã¢ã¯ãã£ããã£ããã®ä¸çªç®ã®ãã£ããã¤ã³ã¹ã¿ã³ã¹ãå¾ãããã¯ãâ¦ãªãã§ãã98%失æãã¦ãã¾ããã½ã¼ã¹ãè¦ãã¨åããã¾ããããã£ããã¤ã³ã¹ã¿ã³ã¹ãçæããå¾ã«ãã®ãã£ãããæ£ããããã§ãã¯ãã¦ãããã§ãããããã§ã¨ã©ã¼ãèµ·ãã¦ãã¾ããã¨ãããã¨ãªã®ã§ãChat()ã¡ã½ããã使ããã«ãSkype4Py.chat.Chat(self.skype,ActiveChats.Name.split(' ')[0])ã¨ç´æ¥ã¤ã³ã¹ã¿ã³ã¹ãçæããããã«ãããç¡äºã«ã¤ã³ã¹ã¿ã³ã¹ãå¾ãããlsã³ãã³ããæ©è½ããããã«ãªãã¾ãããã¾ãæ£ãããã®ãã§ãã¯å¦çããã¦ãªã訳ãªãã§ããå¤å大ä¸å¤«ã ã¨æãã¾ãã
ã»add,kick
ãããã®ã³ãã³ããå®è¡ããã¨ãå¦çã¯å®äºãããã®ã®ä½æ
ãä¾å¤ãçºçãã¾ããã¨ããããskyshã§ã¯æç²ãã¦passãã¦ã¾ãã
ã»ã³ãã³ãã®typo
ã³ãã³ããtypoããã¨ãã®ã¾ã¾ãã£ããã¡ãã»ã¼ã¸ã¨ãã¦éä¿¡ããã¦ãã¾ãã®ã§æ°ãã¤ãã¦ãã ãã(ã¿ãã§è£å®ããã¨ããã¨æãã¾ã)ãããã¡ãã»ã¼ã¸ã®å
é ã§ã³ãã³ãåãéä¿¡ãããã®ã§ããã° \ ã§ã¨ã¹ã±ã¼ããã¦ãã ããã
ã¾ããMacã§ã¯ãã®ã¾ã¾ã ã¨segmentation faultãã¾ããこちらãåèã«ãã¦ä¸ãããããã«ãMacããã©ã«ãã®pythonã ã¨æ¥æ¬èªãä¸æãæ±ããªããããªã®ã§ããããããªãã°Macportsãæ¬å®¶ãµã¤ãããå¥ã®ããã¦ã³ãã¼ããã¦ã¿ã¦ä¸ããã
ãã¨ã¯ãã¾ã«è¡¨ç¤ºãå´©ãããã¨ãããã¾ããã¾ãä»æ§ã§ã(ããã¨ãããç¸æã®ã¡ãã»ã¼ã¸ãåä¿¡ããæã«èªåã®ç¾å¨ã®è¡ã®ä¸ã«åºåãããæ¹æ³ã¯ã誰ãã©ãã¿ã¦ãéªéãªããæ¹ããã¦ããã®ã§ä½ãããæ¹æ³ããã£ããæãã¦ãã ããâ¦ã
ãã®ä»(ææ³ãªã©)
ã¨ããããæ®éã«ãã£ããã§ããã¬ãã«ã«ã¯ãªã£ã¦ããã¨æãã¾ããã¨ããããä»ã«è¿½å ãããæ©è½ã¯ã
ã»ã¦ã¼ã¶ã¼ãã³ã³ã¿ã¯ããªã¹ãã«è¿½å ãã
ã»ãã¡ã¤ã«ãéåä¿¡ãã
ã»ãã£ããã¿ã¤ãã«ãå¤æ´ãã
ã§ãããããæ¹ãããåããã¾ãã(ã§ããªã?)ããã¨è²ããªãããã¾ãã¡ã ãã256è²ã«ããããªããã¨ã¯ãããã®ã®èªåã¯Skypeã®ããã¼ã¦ã¼ã¶ã¼ãããªãããããã§ããããªããã¾ãåä½ç¢ºèªã¨ãã¯ãã¦ãªãã®ã§å¤åããããªã¨ããããããããããã¨æãã¾ãããä½ããã£ããã¡ã¼ã«ãããã«ã³ã¡ã³ãé ããã¨ããããã§ãã
ä½æã«ãã£ãã£ã¦åèã«ãããµã¤ã
ã»http://blog.cohtan.org/2009/02/terminalskypeskypeshpy.html
ãããè¦ã¦Skype4Py à cmd.Cmd ã§ä½ãã¾ããã
ã»Skype4Py
ã»http://74.125.153.132/search?q=cache:s0RyBuD20q8J:d.hatena.ne.jp/kakurasan/20090310/p1+python+url+%E9%96%8B%E3%81%8F&cd=1&hl=ja&ct=clnk&gl=jp
ã»Regex for URL extracting - Python