Skip to content

tee0zed/simple_weather

Repository files navigation

Simple Weather

A simple temperature data fetcher on ruby.

status

Providers

Part of Thinknetica codecamp task that got out of control lmao

выглядит хорошо на самом деле)

-Artem Krivonozhko, Thinknetica

Usage

gem install simple_weather
require 'simple_weather'

 SimpleWeather.fetch(
   provider: :open_weather, 
   units: :metric, 
   request_name: :current_weather, 
   params: {lat: 1.33, lon: 1.33}
 ).temperature
args = {
  provider: [:open_weather, :weather_api], 
  units: [:metric, :imperial],
  request_name: [:current_weather, :history_weather],
  params: [
    {lat: 1.33, lon: 1.33}, # for current_weather
    {lat: 1.33, lon: 1.33, date: Date.today.iso8601}  # for history_weather
  ]
}

API keys

Look up for the .env file in the root project, override native with .dotenv or others

  • OPEN_WEATHER_KEY=
  • WEATHER_API_KEY=

or just use defaults

About

Simple Weather gem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published