
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Sundown is a Ruby gem/wrapper for Yahoo Weather API. Sundown is compatible with 1.9.3 +, and with almost all ruby frameworks. You don't need to have a Yahoo Developer account to start using gem, Yahoo Weather API provides free API calls upto 2k queries. This gem queries weather information from Yahoo Weather API.
Add this line to your application's Gemfile:
gem 'sundown'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sundown
Require gem in your code class.
require 'sundown'
You can access weather data by using two different class depends on your usage, since we've a limited query calls to Yahoo API(2K/day), we should query all data at once and serve it later without firing queries.
###Use Location class (less query calls and faster )
Using location is recommended in a high traffic scenario, this method does make create instance the first time, resulting less queries and faster performance.
Create a instance object for Location.
location = Sundown::Location.new('location_name/woeid')
NOTE: You can use zipcode to find information but make sure you put country before zip code. eg. 'india 680689'
location.temperature => Returns temp. in Farenheit.
location.temperature('c') => Returns temp. in Celsious.
Each time when you call location.temperature
you are reusing weather data from existing instance, so it may not serve latest information, instance doesn't refresh weather information unless you call refresh
on that object.
To delete current weather information instance,
location.refresh => Deletes current weather instance.
To get timestamp of weather information(Weather recorded time) you can call timestamp
on that object.
To get current weather timestamp,
location.timestamp => Deletes current weather instance.
###Use Weather class (Fires query each time, less perfomance)
Whenever you call this method, a query will be fired to find weather information, meaning you can only call this 2K/day(due to 2k/day limit from Yahoo). This method will return latest weather information, also this method takes more time as it needs to fetch weather information from Yahoo API.
temperature = Sundown::Weather.temperature('location_name/woeid')
Use parameter 'c' to get temperature in Celsius.
The above feeds are provided free of charge for use by individuals and non-profit organizations for personal, non-commercial uses. Yahoo reserve all rights in and to the Yahoo logo, and your right to use the Yahoo logo is limited to providing attribution in connection with these RSS feeds.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that sundown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.