Python3.6之给指定用户发送微信消息

Python3.6之给指定用户发送微信消息

#!/usr/bin/python3
# -*- coding: utf-8 -*-

import datetime
import time
import requests
import json

github_url = "http://192.168.1.70:8080/robot/messageServlet2"

data = json.dumps({'name': 'test', 'phone': 139})

url = 'http://192.168.1.70:8080/robot/messageServlet2'
# r = requests.post(url, data={'name': 'test', 'phone': 'some test repo'})

while 1:
    now = datetime.datetime.now()
    now_str = now.strftime('%Y/%m/%d %H:%M:%S')[11:]
    print('\r{}'.format(now_str), end='')
    r = requests.post(url, data={'name': 'test', 'phone': 139, 'content': '内容'})
    print(r.text.data)
    time.sleep(1)

print("结束")
posted @ 2018-10-10 10:36 花生福 阅读( ...) 评论( ...) 编辑 收藏
发布了57 篇原创文章 · 获赞 10 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/zh_1721342390/article/details/89596811
今日推荐