Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

meteoalarm

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meteoalarm

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Meteoalarm

Meteoalarm serves as an API wrapper for meteoalarm.org, a platform delivering hydrometeorological warnings across the European region. This gem simplifies the process of retrieving warnings based on country, specific coordinates or area, along with a few additional options.

Installation

Add this line to your Gemfile:

gem 'meteoalarm'

And then execute:

bundle install

Or install it directly:

gem install meteoalarm

Usage

require 'meteoalarm'

# Get alarms for a specific country by its ISO 3166-1 A-2 code
Meteoalarm::Client.alarms('FR', **options) # Example: France
Options
  • :latitude and :longitude: Check alarms for a specific coordinates.
  • :area: Check alarms for a specific area.
  • :active_now: Check currently active alarms.
  • :date: Check alarms by date.
  • :expired: Include expired alarms.
Examples
require 'meteoalarm'

# Check alarms by coordinates
Meteoalarm::Client.alarms('FR', latitude: 48.84307, longitude: 2.33662)

# Check alarms by area
Meteoalarm::Client.alarms('FR', area: 'Paris')

# Check currently active alarms
Meteoalarm::Client.alarms('FR', active_now: true)

# Check alarms by date
Meteoalarm::Client.alarms('FR', date: Date.new(2024, 1, 21))

# Include expired alarms
Meteoalarm::Client.alarms('FR', expired: true)

# Or combine the options
Meteoalarm::Client.alarms('FR', area: 'Paris', active_now: true)

Rake tasks

To incorporate Meteoalarm rake tasks into your project, include the following code in your Rakefile:

require 'meteoalarm'

spec = Gem::Specification.find_by_name 'meteoalarm'
Dir.glob("#{spec.gem_dir}/lib/meteoalarm/tasks/*.rake").each { |f| import f }

By adding this code, you will gain access to the following rake tasks:

rake meteoalarm:countries
    List all countries in Meteoalarm system

rake meteoalarm:areas
    List all areas of given COUNTRY_CODE in Meteoalarm system

Contributing

Your contributions are welcome and appreciated. If you find issues or have improvements, feel free to open an issue or submit a pull request.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 13 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc