jubi.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:stock 作者: Rockyzsu 项目源码 文件源码
def warming(self, coin, up_price, down_price,user):
        url = 'https://www.jubi.com/api/v1/ticker/'
        while 1:
            time.sleep(5)
            try:
                data = requests.post(url, data={'coin': coin}).json()
            except Exception,e:
                print e
                print "time out. Retry"
                time.sleep(15)
                continue

            current = float(data['last'])
            if current >= up_price:
                print "Up to ", up_price
                print "current price ",current

                if self.send=='msn':
                    self.send_text(coin,str(current))
                if self.send=='wechat':
                    self.send_wechat(coin,str(current),user)

                time.sleep(1200)
            if current <= down_price:
                print "Down to ", down_price
                print "current price ",current
                if self.send=='msn':
                    self.send_text(coin,str(current))
                if self.send=='wechat':
                    self.send_wechat(coin,str(current),user)
                time.sleep(1200)
    #????????????
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号