{"id":24836850,"url":"https://github.com/weatherxu/weatherxu-ruby","last_synced_at":"2026-02-11T15:32:30.663Z","repository":{"id":275039032,"uuid":"924354234","full_name":"weatherxu/weatherxu-ruby","owner":"weatherxu","description":"Official Ruby SDK for WeatherXu","archived":false,"fork":false,"pushed_at":"2025-01-29T21:10:32.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-03T16:59:06.309Z","etag":null,"topics":["api","forecast","rails","ruby","weather"],"latest_commit_sha":null,"homepage":"https://weatherxu.com/","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/weatherxu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-29T21:10:13.000Z","updated_at":"2025-01-29T21:11:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"c87ab329-dd4d-4a1d-9ec8-0defe8fc90b5","html_url":"https://github.com/weatherxu/weatherxu-ruby","commit_stats":null,"previous_names":["weatherxu/weatherxu-ruby"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/weatherxu/weatherxu-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weatherxu%2Fweatherxu-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weatherxu%2Fweatherxu-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weatherxu%2Fweatherxu-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weatherxu%2Fweatherxu-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weatherxu","download_url":"https://codeload.github.com/weatherxu/weatherxu-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weatherxu%2Fweatherxu-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29336868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T14:34:07.188Z","status":"ssl_error","status_checked_at":"2026-02-11T14:34:06.809Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","forecast","rails","ruby","weather"],"created_at":"2025-01-31T05:43:59.237Z","updated_at":"2026-02-11T15:32:30.652Z","avatar_url":"https://github.com/weatherxu.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WeatherXu Ruby SDK\n\nOfficial Ruby SDK for accessing WeatherXu's weather data API.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'weatherxu'\n```\n\nAnd then execute:\n```bash\n$ bundle install\n```\n\nOr install it yourself as:\n```bash\n$ gem install weatherxu\n```\n\n## Quick Start\n\n```ruby\nrequire 'weatherxu'\n\n# Initialize the client\nclient = WeatherXu.new(\n  api_key: 'YOUR_API_KEY',\n  units: 'metric'\n)\n\nbegin\n  # Get current weather and forecast for New York City\n  weather = client.get_weather(\n    lat: 40.7128,\n    lon: -74.0060,\n    parts: ['currently', 'hourly', 'daily']\n  )\n\n  # Access current conditions\n  puts \"Current temperature: #{weather.currently.temperature}°C\"\n\n  # Access hourly forecast\n  weather.hourly\u0026.each do |hour|\n    puts \"Time: #{hour.forecast_start.strftime('%Y-%m-%d %H:%M')}, \" \\\n         \"Temperature: #{hour.temperature}°C\"\n  end\n\n  # Get historical weather data\n  end_time = Time.now.to_i\n  start_time = end_time - (24 * 60 * 60) # 24 hours ago\n\n  historical = client.get_historical(\n    lat: 40.7128,\n    lon: -74.0060,\n    start: start_time,\n    end_time: end_time\n  )\n\n  # Access historical data\n  historical.hourly.each do |record|\n    puts \"Time: #{record.forecast_start.strftime('%Y-%m-%d %H:%M')}, \" \\\n         \"Temperature: #{record.temperature}°C\"\n  end\nrescue WeatherXu::Error =\u003e e\n  puts \"Error: #{e.message}\"\n  puts \"Status code: #{e.status_code}\" if e.status_code\n  puts \"Error code: #{e.error_code}\" if e.error_code\nend\n```\n\n## Features\n\n- Modern Ruby features and best practices\n- Automatic parsing of timestamps to Time objects\n- Comprehensive error handling\n- Support for both metric and imperial units\n- Configurable request timeout\n- Automatic retries with exponential backoff\n\n## API Reference\n\n### Initialization\n\n```ruby\nWeatherXu.new(\n  api_key: String,\n  units: String = \"metric\",\n  timeout: Integer = 10\n)\n```\n\n### Methods\n\n#### get_weather\n\nGet current weather and forecast data for a location.\n\n```ruby\nget_weather(\n  lat: Float,\n  lon: Float,\n  parts: Array\u003cString\u003e = nil,\n  units: String = nil\n) -\u003e WeatherData\n```\n\nParameters:\n- `lat`: Latitude (-90 to 90)\n- `lon`: Longitude (-180 to 180)\n- `parts`: Optional array of data blocks to include ('alerts', 'currently', 'hourly', 'daily')\n- `units`: Optional unit system ('metric' or 'imperial')\n\n#### get_historical\n\nGet historical weather data for a location.\n\n```ruby\nget_historical(\n  lat: Float,\n  lon: Float,\n  start: Integer,\n  end_time: Integer,\n  units: String = nil\n) -\u003e HistoricalData\n```\n\nParameters:\n- `lat`: Latitude (-90 to 90)\n- `lon`: Longitude (-180 to 180)\n- `start`: Start time (Unix timestamp)\n- `end_time`: End time (Unix timestamp)\n- `units`: Optional unit system ('metric' or 'imperial')\n\n## Error Handling\n\nThe SDK raises `WeatherXu::Error` for any API or network-related errors. Each error includes:\n- Error message\n- HTTP status code (when available)\n- API error code (when provided by the API)\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Requirements\n\n- Ruby 2.7 or higher\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweatherxu%2Fweatherxu-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweatherxu%2Fweatherxu-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweatherxu%2Fweatherxu-ruby/lists"}