天气接口API:
http://t.weather.itboy.net/api/weather/city/ + 城市代码
城市代码查询入口:
https://where.heweather.com/index.html
#!/usr/bin/python3
#coding=utf-8
import requests, json
spkey = 'xxxxxxxxxxxx' #https://qmsg.zendee.cn ---> 去这个地址注册,获取key,然后添加绑定机器人
def get_iciba_everyday():
icbapi = 'http://open.iciba.com/dsapi/'
eed = requests.get(icbapi)
bee = eed.json() #返回的数据
english = bee['content']
zh_CN = bee['note']
str = '【奇怪的知识】\n' + english + '\n' + zh_CN
return str
def main(arg1,arg2):
try:
api = 'http://t.weather.itboy.net/api/weather/city/' #API地址,必须配合城市代码使用
city_code = '101230508' #进入https:<