zoukankan      html  css  js  c++  java
  • python 微信轰炸

    from __future__ import unicode_literals
    import requests
    import itchat
    import time
    
    def get_news():
        url = "http://open.iciba.com/dsapi"
        r = requests.get(url)
        contents = r.json()['content']
        translation = r.json()['translation']
        return contents, translation
    
    def send_news():
        try:
            # 登陆你的微信账号,会弹出网页二维码,扫描即可
            itchat.auto_login(hotReload=True)
            # 改成你最心爱的人的名字。
            my_friend = itchat.search_friends(name=u'要发的人')
            # 获取对应名称的一串数字
            XiaoMing = my_friend[0]["UserName"]
            # 消息设置
            message3 = "来自微信自动化测试"
            # 发送消息
            for i in range(1, 10):
                itchat.send(message3, toUserName=XiaoMing)
            # t = time(1, send_news())
            # t.start()
        except:
            message4 = u"/(ㄒoㄒ)/~~"
            itchat.send(message4, toUserName=XiaoMing)
    
    def main():
        send_news()
    
    if __name__ == '__main__':
        main()

  • 相关阅读:
    Mysql高级第一天(laojia)
    Mysql初级第三天(wangyun)
    Mysql初级第二天(wangyun)
    Mysql初级第一天(wangyun)
    Spring的源码解析
    JAVA8新特性
    java8
    JMM内存模型
    JAVA并发工具类
    mybatis
  • 原文地址:https://www.cnblogs.com/sxqfuture/p/10256565.html
Copyright © 2011-2022 走看看