Narnia's Poofy Meatcleaver
Join us to discuss the challenges, solutions and best practices for in-house JavaScript code sharing. Tuesday, 12/17 at 10am PT/1pm ET.Sign up here »

dashbling-widget-weather

2.0.2 • Public • Published

Dashbling weather widget

This is a widget for Dashbling, displaying local Weather information.

Weather information is provided by OpenWeatherMap. This widget requires a (free) OpenWeatherMap API key. Register at https://openweathermap.org/appid.

Usage

Add to your project:

yarn add dashbling-widget-weather

Add a job to fetch weather data:

// dashbling.config.js
module.exports = {
    jobs: [
        {
            schedule: "*/30 * * * *",
            fn: require("dashbling-widget-weather/job")(
                "weather-amsterdam", // event id
                "YOUR OPENWEATHERMAP APPID HERE",
                "2759794" // city id
            )
        }
    ]
}

And add the widget to your dashboard:

import { WeatherWidget } from "dashbling-widget-weather";
const WeatherInAmsterdam = connect("weather-amsterdam")(WeatherWidget);
 
export default props => {
  return (
    <Dashboard>
      <WeatherInAmsterdam title="Amsterdam" />
    </Dashboard>
  );
};

Keywords

none

Install

npm i dashbling-widget-weather

DownloadsWeekly Downloads

24

Version

2.0.2

License

MIT

Unpacked Size

313 kB

Total Files

24

Last publish

Collaborators

  • avatar