{"id":18158367,"url":"https://github.com/codesalley/openweather","last_synced_at":"2025-05-07T04:11:41.620Z","repository":{"id":47329424,"uuid":"395458576","full_name":"codesalley/openweather","owner":"codesalley","description":"Open weather gem, A wrapper around openweathermap.org API. ","archived":false,"fork":false,"pushed_at":"2023-02-17T23:13:14.000Z","size":53,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T04:11:34.746Z","etag":null,"topics":["gem","openweather","openweather-api","openweathermap","ror","ruby","ruby-gem","ruby-on-rails","weather"],"latest_commit_sha":null,"homepage":"https://openweathermap.org","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codesalley.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-12T22:30:23.000Z","updated_at":"2024-04-28T22:13:26.000Z","dependencies_parsed_at":"2022-08-27T11:03:07.803Z","dependency_job_id":null,"html_url":"https://github.com/codesalley/openweather","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesalley%2Fopenweather","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesalley%2Fopenweather/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesalley%2Fopenweather/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesalley%2Fopenweather/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codesalley","download_url":"https://codeload.github.com/codesalley/openweather/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810274,"owners_count":21807759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem","openweather","openweather-api","openweathermap","ror","ruby","ruby-gem","ruby-on-rails","weather"],"created_at":"2024-11-02T07:06:27.846Z","updated_at":"2025-05-07T04:11:41.598Z","avatar_url":"https://github.com/codesalley.png","language":"Ruby","funding_links":[],"categories":["\u003ca name=\"O\"\u003e \u003c/a\u003eO"],"sub_categories":[],"readme":"# OpenWeather\n\nOpen Weather Gem, A wrapper around open weather API, makes working with weather fun.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'open_weather_sdk'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install open_weather_sdk\n\n## Usage\n\n### Configuration\n\nCreate a config file in initializers and add an API key `config/initializers/open_weather.rb`\n\n```ruby\nOpenWeather.config do |config|\n  config.api_key = 'your key'\nend\n```\n\n## Current Weather Data\n\nParams Overview\n\n```swift\n  ||- name -\u003e string\n  ||- id -\u003e string || integer, read more about city id's on https://openweathermap.org/current#cityid\n  ||- coords -\u003e array [lon, lat]\n  ||- zipcode -\u003e string || integer\n  ||- country -\u003e string: country code eg: GH -\u003e Ghana\n  |[optional]|- lang -\u003e string: eg: en -\u003e english, fr -\u003e french\n  |[optional]|- units -\u003e string: eg: standard, metric, imperial\n\n```\n\n### Get weather by city name\n\n- ```ruby\n  OpenWeather::CurrentWeather.by_city(name: \"london\") #params: name -\u003e \"london\", lang -\u003e 'en', units -\u003e \"standard\"\n  return =\u003e {\"coord\"=\u003e{\"lon\"=\u003e-0.1257, \"lat\"=\u003e51.5085}, \"weather\"=\u003e[{\"id\"=\u003e804, \"main\"=\u003e\"Clouds\", \"description\"=\u003e\"overcast clouds\", \"icon\"=\u003e\"04n\"}], \"base\"=\u003e\"stations\", \"main\"=\u003e{\"temp\"=\u003e291.69, \"feels_like\"=\u003e291.66, \"temp_min\"=\u003e289.32, \"temp_max\"=\u003e293.05, \"pressure\"=\u003e1022, \"humidity\"=\u003e79}, \"visibility\"=\u003e10000, \"wind\"=\u003e{\"speed\"=\u003e3.6, \"deg\"=\u003e220}, \"clouds\"=\u003e{\"all\"=\u003e97}, \"dt\"=\u003e1628885709, \"sys\"=\u003e{\"type\"=\u003e2, \"id\"=\u003e2019646, \"country\"=\u003e\"GB\", \"sunrise\"=\u003e1628829784, \"sunset\"=\u003e1628882870}, \"timezone\"=\u003e3600, \"id\"=\u003e2643743, \"name\"=\u003e\"London\", \"cod\"=\u003e200}\n  ```\n\n### Get weather by zipcode and country code. more info -\u003e [openweathermap.org](https://openweathermap.org/current#zip)\n\n- ```ruby\n    OpenWeather::CurrentWeather.by_zip(zipcode: 94040, country: \"us\")\n     #params: zipcode -\u003e 94040, lang -\u003e 'en', units -\u003e \"standard\"\n  ```\n\n### Get weather by geographic coordinates[lon, lat]. more info -\u003e [openweathermap.org](https://openweathermap.org/current#geo)\n\n- ```ruby\n      OpenWeather::CurrentWeather.by_coords(coords: [-0.8393, 9.40078])\n      #params: coords -\u003e [lon, lat], lang -\u003e 'en', units -\u003e \"standard\"\n  ```\n\n### Get weather by city id. more info -\u003e [openweathermap.org](https://openweathermap.org/current#cityid)\n\n- ```ruby\n    OpenWeather::CurrentWeather.by_city_id(id: 2294877)\n     #params: id -\u003e 2294877, lang -\u003e 'en', units -\u003e \"standard\"\n  ```\n\n## Hourly Forecast 4 days [Requires Pro Api]\n\n```ruby\n    OpenWeather::HourlyForecast.by_city(# name, units, lang)\n    OpenWeather::HourlyForecast.by_city_id(# id, units, lang)\n    OpenWeather::HourlyForecast.by_coords(# [lon lat], units, lang)\n    OpenWeather::HourlyForecast.by_find(# [lon, lat], count, units, lang)\n    OpenWeather::HourlyForecast.by_zip(# zipcode, units, lang)\n```\n\n## Follow me √\n\n[Twitter ≈\u003e codesalley](https://twitter.com/codesalley)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/codesalley/openweather.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesalley%2Fopenweather","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesalley%2Fopenweather","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesalley%2Fopenweather/lists"}