az.py 文件源码

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

项目:amdRestock 作者: supthunder 项目源码 文件源码
def sendTweet(link, site, name):
    global restock
    # setup twitter
    C_KEY = "C_KEY"
    C_SECRET = "C_SECRET"
    A_TOKEN = "A_TOKEN"
    A_TOKEN_SECRET = "A_TOKEN_SECRET"
    auth = tweepy.OAuthHandler(C_KEY, C_SECRET)  
    auth.set_access_token(A_TOKEN, A_TOKEN_SECRET)  
    api = tweepy.API(auth)

    # send tweet
    alert = "\U0001f6a8 "
    sos = "\U0001f198 "
    flag = "\U0001f6a9 "
    tweet = alert+sos+flag+" IN STOCK "+flag+sos+alert
    tweet += "\n"+name
    tweet += "\nSite: "+site+"\n"
    tweet += link+"\n"
    tweet += strftime("%Y-%m-%d %H:%M:%S", gmtime())
    print(tweet)
    api.update_status(tweet.encode('utf-8'))
    restock = 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号