Myluzh Blog

Strive to become a dream architect.

python3 itchat微信自动回复机器人

2020-12-19 myluzh Python

import itchat import requests import random import time def get_response(msg): url = 'http://i.itpk.cn/api.php'#自动回复API接口 data = { #接口参数 'api_key': 'xxxx', # Tuling Key,API的值 'api_secret': 'xxxx', # Tuling Key,API的值 'question': msg, # 发出去的消息 'type':'普通文本', 'limit':'8' } print('提出问题',msg) rqq = requests.post(url, data=data) # 当自动检测编码不正确时,手动指定编码 rqq.encoding = 'utf-8' print('响应内容:', rqq.text) time.sleep(random.ra...

阅读全文>>

标签: itchat 自动回复 python3

评论(0) (610)

python itchat拦截微信群或好友撤回消息

2020-11-26 myluzh Python

import sys import os, re, shutil, time, collections, json from html.parser import HTMLParser from xml.etree import ElementTree as ETree import itchat from itchat.content import * msg_store = collections.OrderedDict() timeout = 600 sending_type = {'Picture': 'img', 'Video': 'vid'} data_path = 'data' nickname = '' bot = None if __name__ == '__main__': if not os.path.exists(data_path): os.mkdir(data_path) # if the QR code doesn't show correctly, you can try to change the value ...

阅读全文>>

标签: itchat python3

评论(0) (553)