DEV
BLOG
  • Design
  • Data
  • Discernment

We believe in AI and every day we innovate to make it better than yesterday. We believe in helping others to benefit from the wonders of AI and also in extending a hand to guide them to step their journey to adapt with future.

Know more

Our solutions in action for customers

DOWNLOAD

Featured Post

How we spoke to data in 2 days

What would you do in two days? Let me be more precise, what would you do on a weekend? Depending on the kind of person you are, the answers may differ. Some may wanna stay in, have a good sleep, take it slow. If you are like me, you would be on the road riding […]

Know More

MENU

  • HOME
  • SERVICES
  • PRODUCTS
  • CASE STUDIES
  • INDUSTRIES
  • CAREERS
  • CONTACT US

Artificial Intelligence

Blockchain

Enterprise Solutions

Blog
White Papers
Resources
Videos
News

Why I Built an Open Source Weather Data Widget

  • mm
    by Rahul Raveendran on Mon Oct 7

We already know this,

Climate change is around the corner!

I’ve been developing apps for about 5 years and never did I get a chance to work on something related to climate and weather predictions until this month. I was assigned to this new project to build an app that uses climatic data for generating a handful of insights for a lot of business use cases. (Unfortunately, I am not allowed to talk anymore in detail about the app or its idea. All hail NDA!)

Besides forecasts, weather data find itself useful in many applications – From usual weather prediction applications to large projects where weather analysis is just one component of a larger objective. However, accurate and reliable weather data is essential for developing various weather-related applications. Having access to accurate weather data is a different story altogether. Let me tell you why!

While working on this project for a high-profile multinational company, I was required to display weather information in mobile and web interfaces. However, when I started working on it, I realized an interesting challenge. Despite the fact that a ‘climate change’ is a trending topic, there isn’t a single customizable opensource widget available anywhere. Why hasn’t anyone built it before?

Obviously, there is a demand or will be a high demand in the near future.

To meet the need, I had to build a widget from scratch. Building this widget was a bit difficult for me, and I assume it would be the same and unnecessary time waste for anyone who’d want to build it in the future. Be it small businesses, entrepreneurs, individual developers, and students. So I’m open-sourcing it for anyone who may need to use it in their application, be it web or mobile app.

I’ve incorporated as many customization options in the widgets as possible. With Angular JS as the chosen platform, I created a Weather Widget that can display weather information of any location. It provides weather data to the developers to build web services and web applications that require weather information. I used APIUX weather API to fetch weather details. The widget can display weather details such as temperature, wind speed and the forecast of any given region.

Getting Started: Installation

The Weather Widget package is published in the npm Registry.

Install the package:

npm install angular2-weather-widget --save

Once installed import AngularWeatherWidgetModule from the installed package into your module as follows:

Usage

Import  AngularWeatherWidgetModule  into  NgModule  in  app.module.ts. Angular’s  HttpClientModule  and  CommonModule   is also required.

import { AngularWeatherWidgetModule } from 'angular2-weather-widget';
import { HttpClientModule } from '@angular/common/http';
import { CommonModule } from '@angular/common';
 
@NgModule({
  // ...
  imports: [
    AngularWeatherWidgetModule,
    HttpClientModule,
    CommonModule
  ]
  // ...
})

Add the following component tag in your template (no properties)

<angular-weather-widget
  [APIKEY]="'APIKEY'">
</angular-weather-widget>

The advantage of this weather widget is that it can be easily embedded in any website or web application. The widget “at-a-glance” shows the relevant weather data that is accessible right from the user’s screen. It eliminates the need to build a weather data platform from scratch. It is designed to work flawlessly and has no high server-side requirements. The users can customize nearly everything such as the colors of every element, the size of the widget, font, size, etc.

Author

  • mm
    Rahul Raveendran

Rahul Raveendran is a software developer at Accubits Technologies. His expertise has been focused on developing and delivering web applications using cutting edge technology and providing outstanding client service. He has 5 years of experience transforming ideas into products using code. He is a Tech enthusiast, contributor to various open-source projects and always ready to go the extra mile for perfection.

Related Posts

Drive into stories worth discussing

  • mm
    How Big/Small Should Be Your Contribution To The Open Source?
    Nithya Rajan

Categories

View articles by categories

  • Uncategorized

Subscribe now to get our latest posts

All Rights Reserved. Accubits INC 2020