ãã¸ããã!! iPhone ã«ä½ã§ãéç¥
http://im.kayac.com/
ããã使ã£ã¦
iPhone ã¢ããª
ã«éç¥åºæ¥ã¾ãã
ã¨ããããã³ã¼ã
#!/usr/bin/env python # -*- coding: utf-8 -*- import hashlib import urllib2, urllib class IMKayac: def __init__(self,id,password=None,sig=None): self.id = id self.password = password self.sig = sig def notify(self,msg): if isinstance(msg, unicode): msg = msg.encode('utf-8') path = 'http://im.kayac.com/api/post/%s' % self.id params = { 'message':msg, } if self.password: params['password'] = self.password if self.sig: params['sig'] = hashlib.sha1(msg+self.sig).hexdigest() print self.getOpener().open(path, urllib.urlencode(params)) def getOpener(self): opener = urllib2.build_opener() opener.addheaders = [ ('User-agent', 'TwitterCloneClient(http://d.hatena.ne.jp/jYoshiori/)'), ] return opener if __name__ == '__main__': from pit import Pit im_kayac_config = Pit.get('im.kayac.com',{'require' : { 'id' : 'Your im.kayac.com name', 'password' : 'Your im.kayac.com password' }}) im = IMKayac(im_kayac_config['id'], im_kayac_config['password']) im.notify(u'typester++')
ããã§æ¬å½ã«ãªãã§ãéç¥åºæ¥ã¾ãã!!!
hudson ã®ãã©ã°ã¤ã³ã¨ãä½ããããªãâª
typester++