A simple temperature data fetcher on ruby.
Part of Thinknetica codecamp task that got out of control lmao
выглядит хорошо на самом деле)
-Artem Krivonozhko, Thinknetica
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
]
}
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