Giter VIP home page Giter VIP logo

email-weather-widget's Introduction

Email Weather Widget

A widget that returns an image that shows weather for the given location (town, country).

To get started on this project I used this article as an instruction to generating images in Node.

The output is created by using the wonderful library by Automattic called node-canvas, which allows you to use the standard browser canvas in Node and output the resulting canvas as an image.

The image is based on the lovely design from this Codepen. Thanks to Colin Espinas for the design.

Email Weather Widget screenshot

Options

City (string)

The name of the city to get the weather for

Country (string)

The ISO 3166 country code

Development

In order to run this locally you will need to do a few things:

  • Generate a local SSL key to use if you want it available on https. I followed the instructions here
  • Run npm i
  • Run npm start or, as I like to do when working on things locally with node use nodemon index.js (npm i -g nodemon), which will live reload the index.js script when you save it

To Do

  • Move functions to external methods and add tests
  • Add a background image to the left side panel
  • Add a forecast (if available from the API)
  • Add colour options
  • Add style Options
  • Change the query params to proper Express parameters with fallback
  • Check that the image being output is transparent
  • Add error checking for the passed city and country
  • Add proper catch statements to return something useful and nice
  • Convert all calculations/positions to a percentage/offset so that the width and height can be easily changed
  • Format the place name properly
  • Add a nice, personal 'Hello' message
  • If there's an error show a proper error page
  • Create a mobile view
  • Add caching

email-weather-widget's People

Contributors

ahallicks avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.