天气API
简单的 JSON API 从三个来源按日期提供 IATA 区域的平均温度:OpenWeatherMap、WorldWeatherOnline 和 Wunderground。
安装
git clone https://github.com/border-radius/weather && cd weather
npm install
cp config.sample.json config.json
不要忘记在配置中设置您的 API 密钥。
要启动服务器,请执行node index 。
测试
npm test
API 使用示例
API 需要两个参数:IATA 代码和日期(可以使用 Date() 解析的任何格式)。
$ curl http://localhost:8030/VKO/2014-11-21
{"temp":-4.93}
$ curl http://local
评论0
最新资源