TwitterAlarm.py 文件源码

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

项目:PokeAlarm 作者: PokeAlarm 项目源码 文件源码
def send_alert(self, alert, info):
            limit = 140
            status = alert['status']
            if status.endswith("<gmaps>"):
                limit = 117  # Save 23 characters for the google maps
                status = status[:-7] # Truncate gmaps
            status = replace(status[:limit], info) # Truncate status
            if limit == 117:
                status += info['gmaps'] # Add in gmaps link
            args = {"status": status}
            try_sending(log, self.connect, "Twitter", self.send_tweet, args)

    # Trigger an alert based on Pokemon info
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号