撸了个工具,台风信息获取node-typhoon
发布于 8 年前 作者 giscafer 3972 次浏览 来自 分享

功能

可查询实时台风信息 和 历史台风信息 详情见github:https://github.com/giscafer/node-typhoon

demo

'use strict';
const Typhoon=require('node-typhoon');

Typhoon.typhoonActivity().then(data=>{
	console.info("============typhoonActivity()===================");
	console.log(data);
}).catch(err=>{
	console.error(err)
});

Typhoon.typhoonList(2016).then(data=>{
	console.info("------------------typhoonList()-----------------");
	console.log(data);
}).catch(err=>{
	console.error(err);
});

结果

============typhoonActivity()===================
[
  {
    "enname": "SARIKA",
    "lat": "15.10",
    "lng": "122.90",
    "movedirection": "西北西",
    "movespeed": "25",
    "name": "莎莉嘉",
    "power": "14",
    "pressure": "950",
    "radius10": "120",
    "radius7": "240",
    "speed": "45",
    "strong": "强台风",
    "tfid": "201621",
    "time": "2016-10-15 20:00:00",
    "timeformate": "10月15日20时"
  },
  {
    "enname": "HAIMA",
    "lat": "9.70",
    "lng": "141.50",
    "movedirection": "西北西",
    "movespeed": "17",
    "name": "海马",
    "power": "8",
    "pressure": "995",
    "radius10": null,
    "radius7": "200",
    "speed": "20",
    "strong": "热带风暴",
    "tfid": "201622",
    "time": "2016-10-15 20:00:00",
    "timeformate": "10月15日20时"
  }
]
------------------typhoonList()-----------------
//内容多省略……
3 回复

好原始的,就2个http的接口。楼主不如在remake写好接口的文档,2个http调用单独写成类库有点牛刀杀鸡了

@welchwsy 更简单的类库npm也有呢。没见过吗。 这只是为了以后方便使用而已。比如我做一个应用 webglearth-typhoon,我不需要关心这一部分的内容,直接得到结果。

回到顶部