sfyc23 / everydaywechat Goto Github PK
View Code? Open in Web Editor NEW微信助手:1.每日定时给好友(女友)发送定制消息。2.机器人自动回复好友。3.群助手功能(例如:查询垃圾分类、天气、日历、电影实时票房、快递物流、PM2.5等)
License: MIT License
微信助手:1.每日定时给好友(女友)发送定制消息。2.机器人自动回复好友。3.群助手功能(例如:查询垃圾分类、天气、日历、电影实时票房、快递物流、PM2.5等)
License: MIT License
找不到对象,怎么办?
[100%]
=============================== warnings summary ===============================
run.py::test_run
/Users/xhchen/PycharmProjects/EverydayWechat/GFWeather.py:29: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
config = yaml.load(f)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
===================== 1 passed, 1 warnings in 0.73 seconds =====================
Process finished with exit code 0
嘿嘿嘿 可以么老哥
centos7上运行,二维码怎么扫?
Getting uuid of QR code.
Downloading QR code.
xdg-open: no method available for opening 'QR.png'
Please scan the QR code to log in.
在 every_msg = soup_texts.find_all('div', class_='fp-one-cita')[0].find('a').text 语句处提示错误:
list index out of range
此项目使用微信网页API,同时如果被电脑端微信登录挤下就需要重新登录或者删除自动重连相关缓存文件重新扫码登录。因为此时被电脑端微信挤下后,已经导致服务器上的热登录失效。
所以:此项目适用于一个专门作为机器人的微信小号登录。
然后还有一些bug,关于itchat的。并不是所以服务器的编码都可以正常显示二维码,本人自己挖出一种方式,需要去修改itchat终端生成二维码的方式。适用另外一个开源库 qrcode-terminal,此方式适用于服务器端二维码打印不能正常识别的同学。
你的python依赖库/itchat/components/login.py
找到121行 替换为 qrcode_terminal.draw(''https://login.weixin.qq.com/l/' + uuid')
每次运行时都会生成二维码,提示我扫描登录。
还是我姿势不对
ImportError: cannot import name 'gfweather' from 'GFWeather'
这如何解决
FYI
可以发送一句土味情话
response = requests.get("https://api.lovelive.tools/api/SweetNothings")
itchat.send(str(response.text),'filehelper')
俺不会用git
Traceback (most recent call last):
File "D:/PycharmProjects/EverydayWechat/run.py", line 1, in
from GFWeather import GFWeather
File "D:\PycharmProjects\EverydayWechat\GFWeather.py", line 5, in
import itchat
ModuleNotFoundError: No module named 'itchat'
我是一个python新人,请问报这个错该怎么处理呀,能下的包我都下了的
Testing started at 15:27 ...
/usr/local/bin/python3.7 /Applications/PyCharm.app/Contents/helpers/pycharm/_jb_pytest_runner.py --path /Users/xhchen/PycharmProjects/EverydayWechat2/run.py
Launching pytest with arguments /Users/xhchen/PycharmProjects/EverydayWechat2/run.py in /Users/xhchen/PycharmProjects/EverydayWechat2
============================= test session starts ==============================
platform darwin -- Python 3.7.2, pytest-4.6.2, py-1.8.0, pluggy-0.12.0
rootdir: /Users/xhchen/PycharmProjects/EverydayWechat2collected 1 item
run.py .**************************************************
每天定时发送时间:1:48
格言获取渠道:词霸(每日英语)
女朋友的微信昵称:古典
女友所在城市名称:桂林
在一起的第一天日期:2017-10-10
最后一句为:来自最爱你的我。
女朋友的微信昵称:陈老师
女友所在城市名称:朝阳区
在一起的第一天日期:2018-11-11
最后一句为:来自你俊美的老公。
获取相关信息...
获取格言信息(双语)...
获取天气信息...
给『古典』发送的内容是:
2019年06月11日 15:27:20
宝贝这是我们在一起的第 609 天。
关好门窗,外出避开低洼地。
温度 : 23.0℃/27.0℃
北风 : <3级
空气 : 39.0
The tragedy of life is not so much what men suffer, but what they miss.
生活的悲剧不在于人们受多少苦,而在于人们错过了什么。
来自最爱你的我。
获取天气信息...
给『陈老师』发送的内容是:
2019年06月11日 15:27:20
宝贝这是我们在一起的第 212 天。
阴晴之间,谨防紫外线侵扰。
温度 : 22.0℃/32.0℃
西风 : <3级
空气 : 76.0
The tragedy of life is not so much what men suffer, but what they miss.
生活的悲剧不在于人们受多少苦,而在于人们错过了什么。
来自你俊美的老公。
发送成功...
[100%]
=========================== 1 passed in 0.97 seconds ===========================
Process finished with exit code 0
locale.setlocale(locale.LC_CTYPE, ''),或者 "locale.setlocale(locale.LC_CTYPE, 'LC_CTYPE="zh_CN.UTF-8')
D:\devtools\Python38\python.exe E:/PyCharmSpace/Python-X/cn/love/GFWeather.py
Traceback (most recent call last):
File "E:/PyCharmSpace/Python-X/cn/love/GFWeather.py", line 247, in
gfweather().start_today_info(True)
File "E:/PyCharmSpace/Python-X/cn/love/GFWeather.py", line 20, in init
self.girlfriend_list, self.alarm_hour, self.alarm_minute, self.dictum_channel = self.get_init_data()
File "E:/PyCharmSpace/Python-X/cn/love/GFWeather.py", line 28, in get_init_data
config = load(f, loader=yaml.FullLoader)
TypeError: load() got an unexpected keyword argument 'loader'
想着每天给家人报天气预报
女朋友用复数?
综上所述,用单数会不会更好?:joy:
Lines 37 to 52 in 5796215
看了下closed的issue, 改了一下GFweather.py里边的对应行,依然提示unsupported locale setting。难道是英文系统的锅?
小白求教。
but README.md show require 3.5 or above.
Getting uuid of QR code.
Downloading QR code.
Please scan the QR code to log in.
Please press confirm on your phone.
Log in time out, reloading QR code.
Getting uuid of QR code.
Downloading QR code.
Please scan the QR code to log in.
Please press confirm on your phone.
Loading the contact, this may take a little while.
Login successfully as Lc
登录成功
昵称错误
求大佬翻牌喵喵吖
我的js版有兴趣可以看一下 https://github.com/gengchen528/wechat-assistant
Log in time out, reloading QR code.
Getting uuid of QR code.
Downloading QR code.
xdg-open: no method available for opening 'QR.png'
Please scan the QR code to log in.
登录成功
获取相关信息...
获取格言信息..
获取天气信息..
Job "gfweather.start_today_info (trigger: cron[hour='0', minute='57'], next run at: 2019-06-08 00:57:00 CST)" raised an exception
Traceback (most recent call last):
File "C:\Python\Python37\lib\site-packages\apscheduler\executors\base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "D:\EverydayWechat-master\GFWeather.py", line 141, in start_today_info
sweet_words=sweet_words)
File "D:\EverydayWechat-master\GFWeather.py", line 233, in get_weather_info
start_datetime = datetime.strptime(start_date, "%Y-%m-%d")
File "C:\Python\Python37\lib_strptime.py", line 577, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "C:\Python\Python37\lib_strptime.py", line 359, in _strptime
(data_string, format))
ValueError: time data ' ' does not match format '%Y-%m-%d'
亲测有效,感谢博主分享的源码,但是不知道为什么使用 pycharm 运行 run.py 的时候没有弹出登录二维码,使用 cmd 运行 python run.py 才会弹出二维码,有其他小伙伴遇到这样的情况吗?
显示登录以后就会自动发送消息吗,有没有确认信息说会几点发给谁呢
土味情话API访问不了了,超时
File "run.py", line 6
SyntaxError: Non-ASCII character '\xe4' in file run.py on line 7, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
这行应该修改成什么样 config = yaml.load(f)
我是写java的, py是小白,求助大佬
运行run.py后报以下错误:
ModuleNotFoundError: No module named 'yaml'
同时在GFWeather.py中, import yaml的“yaml”编译报错 :No module named 'yaml'
不论是在cmd还是在pycharm中,运行之后都会报错,求助
Traceback (most recent call last):
File "run.py", line 21, in
run()
File "run.py", line 9, in run
gfweather().run()
File "D:\git\git\repository\pythonHomework\EverydayWechat\GFWeather.py", line 18, in init
self.girlfriend_list, self.alarm_hour, self.alarm_minute, self.dictum_channel = self.get_init_data()
File "D:\git\git\repository\pythonHomework\EverydayWechat\GFWeather.py", line 37, in get_init_data
girlfriend.get('wechat_name').strip()
AttributeError: 'NoneType' object has no attribute 'get'
name_uuid 怎么获取的 我的微信号是如何登录的呢?
还需要pyyaml和lxml,否则是会提示缺少库的。
requests.exceptions.SSLError: HTTPSConnectionPool(host='login.weixin.qq.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)')))
You can't get access to internet or wechat domain, so exit.
每天发送的数据为none,因为天气API更换了域名,需要修改
weather_url = f'http://t.weather.itboy.net/api/weather/city/{city_code}'
每天都在电脑中登陆微信实在不方便,如果能够让其运行在云服务上就方便很多了。我觉得这是一个common的需求。
说程序自己不是自己写没有诚意。
😢
即拿即用,抱拳了老铁。网络不太稳定,一掉线程序就会中断。怎么样才能保证只要在发送时间有网就能发送成功,而其他时间就算断网了程序还能继续跑呢?
用微信号测了下,没有自动回复消息。。。
树莓派的python是3.5的,代码使用了3.6的新特性,部分修改好跑起来还是没法自动发。
是否考虑兼容?
我个人考虑用go写一个了
程序挂上以后第二天会登录超时,请问一下自动超时时间,或者有没有办法避免他自动超时
ModuleNotFoundError: No module named 'requests'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.