python-定时给指定微信好友发送天气预报和每日一句

参考链接

wxpy: 用 Python 玩微信

Python定时自动给微信好友发送天气预报

  • 源码 weather.py
from wxpy import *
import requests
from datetime import datetime
import time
from apscheduler.schedulers.blocking import BlockingScheduler #定时框架
from urllib.request import urlopen
from bs4 import BeautifulSoup

bot = Bot(cache_path=True)#登陆微信
tuling = Tuling(api_key='4a0488cdce684468b95591a641f0971d')  #机器人api

#单个好友
#friend = bot.friends().search('魏文博')[0]#好友的微信昵称,或者你存取的备注
#location = friend.city
#print(friend)
#print(friend.city)


#好友列表
friendlist = [ensure_one(bot.search(remark_name='我们家小')),
    bot.friends().search(remark_name='任')[0],
    bot.friends().search(remark_name='戴文')[0],
    bot.friends().search(re
  • 18
    点赞
  • 47
    收藏
    觉得还不错? 一键收藏
  • 21
    评论
评论 21
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值