1 Star 0 Fork 0

杜亮/我的QQ

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qq.py 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
杜亮 提交于 2024-07-06 19:12 . 111
'''
Author: duliang [email protected]
Date: 2024-06-25 23:09:28
LastEditors: duliang [email protected]
LastEditTime: 2024-07-06 19:01:18
FilePath:
Description:
'''
import MYQQ_http
from flask import Flask, request, jsonify
from urllib.parse import unquote
import time
from datetime import datetime
from threading import Thread
import uuid
import requests
from getsw import getsw
def get_uuid():
return str(uuid.getnode())
HOUR = 19
MIN = 2
SEC = 0
QQNUM = 3858582700
QQGROUP = 980964246
APIport = 8848
token = 1101
callback_port = 5004
MYQQ_http.echo_mode = True
MYQQ_http.global_set(APIport, token, callback_port)
QQ = MYQQ_http.robot(QQNUM)
SWURL = 'https://16gs832674.oicp.vip/qq'
def check_time():
content = ''
while 1:
now = datetime.now()
print(now, end='\r')
if (now.hour == HOUR) and (now.minute == MIN) and (now.second == SEC):
content = getsw()
# 获取水情信息发送到群里 content = get_water_info()
MYQQ_http.send_msg(bot_name=QQ,
toQQ=QQGROUP,
content=content,
anony=False,
group=True)
time.sleep(1)
# MYQQ_http.send_msg(bot_name=QQ,
# toQQ=QQGROUP,
# content=str(int(time.time())),
# anony=False,
# group=True)
app = Flask(__name__)
@app.route('/qq', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
print(request.json)
resp_json = request.json
try:
t = resp_json['MQ_type']
msg = unquote(resp_json['MQ_msg'], 'utf-8')
print(msg)
except Exception as e:
print(e)
return jsonify({'status': 'ok'})
else:
return jsonify({'status': 'ok'})
if __name__ == '__main__':
t = Thread(target=check_time)
t.daemon = True
t.start()
app.run(host='0.0.0.0', port=5005)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/dulht/my---qq.git
[email protected]:dulht/my---qq.git
dulht
my---qq
我的QQ
master

搜索帮助