No commit activity in last 3 years
No release in over 3 years
FarmsenseWrapper is a lightweight wrapper for the Farmsense API. This gem returns a list of nearby weather stations and probabilities of spring/fall frost dates for each station.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
~> 10.3.2
>= 0
~> 3.0.0

Runtime

~> 0.13.1
 Project Readme

Build Status

FarmsenseWrapper

This gem is a lightweight wrapper for the Farmsense API [Farmsense.net], returning a JSON object of nearest weather stations to the input latitude and longitude and a JSON object of frost probabilities for spring or fall.

Installation

Add this line to your application's Gemfile:

gem 'farmsense_wrapper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install farmsense_wrapper

Usage

FarmSenseWrapper.stations(latitude, longitude)

Return's a JSON object of closest stations. To find the probabilities of frost for a station use the id provided.

$FarmSenseWrapper.stations(42, -112)

> [{
               "id" => "506586",
             "name" => "NORTHW AY AP",
        "elevation" => "1",
              "lat" => "62.966667",
              "lon" => "-141.933334",
         "distance" => "664.584783026827"
    }]

FarmSenseWrapper.dates(id, season)

  • spring: 1
  • fall: 2
FarmSenseWrapper.dates(506586, 2)

> [{
                    "season_id" => "2",
        "temperature_threshold" => "36",
                      "prob_90" => "1016",
                      "prob_80" => "1012",
                      "prob_70" => "1008",
                      "prob_60" => "1005",
                      "prob_50" => "1003",
                      "prob_40" => "0930",
                      "prob_30" => "0927",
                      "prob_20" => "0924",
                      "prob_10" => "0919"
    }]

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request