Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
weatherlink
Advanced tools
Unofficial js wrapper library for WeatherLink v2 API
npm install weatherlink
or
yarn add weatherlink
const Weatherlink = require('weatherlink');
const apiKey = '<replace with your api key>';
const apiSecret = '<replace with your api secret>';
const weatherLink = WeatherLink({apiKey, apiSecret});
Metadata about the weather stations and sensors, as well as the different types of sensors
GET /stations
Get all weather stations associated with your API Key
weatherLink.getAllStations().then(console.log).catch(console.error);
GET /stations/{station-ids}
Get weather stations for one or more station IDs provided
weatherLink
.getStations({stationIds: ['102882']})
.then(console.log)
.catch(console.error);
GET /sensors
Get all sensors attached to all weather stations associated with your API Key
weatherLink.getAllSensors().then(console.log).catch(console.error);
GET /sensors/{sensor-ids}
Get sensors for one or more sensor IDs provided
weatherLink
.getSensors({sensorIds: ['371124', '371125']})
.then(console.log)
.catch(console.error);
GET /sensor-catalog
Get a catalog of all types of sensors
weatherLink.getSensorCatalog().then(console.log).catch(console.error);
This call is not in the official weatherlink documentation
This returns all sensors attached to all weather stations associated with your API Key with their very own specs from sensor catalog. It's just a mix of /sensors
+ /sensor-catalog
weatherLink
.getAllSensorsWithSpecs()
.then((data) => console.log(JSON.stringify(data, null, 2)))
.catch(console.error);
Weather sensor observation data
GET /current/{station-id}
Get current conditions data for one station
weatherLink
.getCurrent({stationId: '102882'})
.then(console.log)
.catch(console.error);
GET /historic/{station-id}
Get historic data for one station ID within a given timerange
Using date-fns
const subDays = require('date-fns/subDays');
const getUnixTime = require('date-fns/getUnixTime');
const now = new Date();
const yesterday = subDays(now, 1);
const startTimestamp = getUnixTime(yesterday);
const endTimestamp = getUnixTime(now);
weatherLink
.getHistoric({stationId: '102882', startTimestamp, endTimestamp})
.then((r) => console.log(JSON.stringify(r, null, 2)))
.catch(console.log);
FAQs
A wrapper library for WeatherLink v2 API
The npm package weatherlink receives a total of 1 weekly downloads. As such, weatherlink popularity was classified as not popular.
We found that weatherlink demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.