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

maju

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maju

  • 0.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

StringHelpers

Get weather information about a city easily with Maju.

Install

Maju is a rubygem package, and it can be installed via gem install command

gem install maju

or you can add to your Gemfile

gem maju

and then run

bundle install

Configuration

After instalation and before usage, you need to create a account onOpen Weather Site and gerenate a API key. To create an API key, follow the steps in this tutorial

After get your API KEY, you need to start a maju client.

 client = Maju::Client.new(api_token: 'YOUR_API_KEY_HERE', lang: 'pt_BR', unit: 'celsius')

Now you will use the instance 'client' to call all public method

Usage

To get today information about weather.

You need to pass city name with params 'city'

 client.current(city: 'Monte Santo de Minas')

or to pass a lat and long cordinates

 client.current(lat: '-21.2049202', long: '-47.0943532')

If you don't know lat and long from city, use geocode method.

Geocode

if you need to find out lat and long of some city you can use geocode method

 client.geocode(city: 'Monte Santo de Minas')

it will returns the array.

NOTE: if the return contains only one object, that is, only one city was found, it will return a direct object. If there is more than one city, an array containing objects will be returned, in the same structure.

[
    {
        "name": "Mococa",
        "lat": -21.464731,
        "lon": -47.002405,
        "country": "BR",
        "state": "São Paulo"
    }
]

Forecasts

To get forecast for the days ahead, you can use the forecast method. If you don't know lat and long informations, use the geocode method.

 client.forecast(lat: '-21.2049202', long: '-47.0943532')

License

StringHelper is available under the MIT license.

FAQs

Package last updated on 17 Feb 2023

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