Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
datapoint-js
Advanced tools
Readme
A JavaScript library for accessing weather data via the Met Office's open data API known as DataPoint.
Disclaimer: This module is in no way part of the DataPoint project/service. This module is intended to simplify the use of DataPoint for JavaScript projects. No support for this module is provided by the Met Office and may break as the DataPoint service grows/evolves. The author will make reasonable efforts to keep it up to date and fully featured.
npm install datapoint-js
bower install datapoint-js
Download the contents of either /src
(for node) or /dist/browser
(for browser) and include them in your project.
var datapoint = require('datapoint-js')
datapoint.set_key("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
site = datapoint.get_nearest_forecast_site(-0.124626, 51.500728)
forecast = datapoint.get_forecast_for_site(site.id, "3hourly")
current_timestep = forecast.days[0].timesteps[0]
console.log("Temperature is " + current_timestep.temperature.value + "°" + current_timestep.temperature.units + " in " + site.name)
Temperature is 15°C in London
<html>
<head>
<title>Datapoint test</title>
</head>
<body>
<h1>Weather</h1>
<p id="weather">Loading...</p>
<script src="../dist/browser/datapoint.js"></script>
<script>
datapoint.set_key("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
site = datapoint.get_nearest_forecast_site(-0.124626, 51.500728);
forecast = datapoint.get_forecast_for_site(site.id);
current_timestep = forecast.days[0].timesteps[0];
document.getElementById("weather").innerHTML =
"Temperature is " + current_timestep.temperature.value + "°" + current_timestep.temperature.units + " in " + site.name;
</script>
</body>
</html>
The contents of the <p>
block is replaced with Temperature is 15°C in London
.
Please feel free to submit issues and pull requests.
To work on the project simply clone the project and run npm install
.
This project uses gulp as its task runner and can be used to browserify the code and generate the documentation.
Documentation is automatically generated using JSDoc and is stored in docs.
To regenerate the documentation simply run
gulp document
GPL v3
FAQs
A JavaScript library for accessing weather data via the [Met Office](http://www.metoffice.gov.uk/)'s open data API known as [DataPoint](http://www.metoffice.gov.uk/datapoint).
The npm package datapoint-js receives a total of 3 weekly downloads. As such, datapoint-js popularity was classified as not popular.
We found that datapoint-js 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.