Module: Bowshock::Earth
- Included in:
- Bowshock
- Defined in:
- lib/bowshock/earth.rb
Class Method Summary collapse
Class Method Details
.assets(object) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/bowshock/earth.rb', line 28 def assets(object) base_url = "https://api.nasa.gov/planetary/earth/assets?" if object["lon"] && object["lat"] base_url += "lon=#{object["lon"].to_s}&lat=#{object["lat"].to_s}&" end if object["begin"] base_url += "begin=#{Helpers.vali_date(object["begin"])}&" end if object["end"] base_url += "end=#{Helpers.vali_date(object["end"])}&" end req_url = "#{base_url}api_key=#{Helpers.nasa_api_key}" Helpers.getJson(req_url, "GET") end |
.imagery(object) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bowshock/earth.rb', line 3 def imagery(object) base_url = "https://api.nasa.gov/planetary/earth/imagery/?" if object["lon"] and object["lat"] base_url += "lon=#{object["lon"].to_s}&lat=#{object["lat"].to_s}&" end if object["date"] base_url += "date=#{Helpers.vali_date(object["date"])}&" end if object["cloud_score"] base_url += "cloud_score=#{object["cloud_score"]}&" end if object["dim"] base_url += "dim=#{object["dim"]}&" end req_url = "#{base_url}api_key=#{Helpers.nasa_api_key}" Helpers.getJson(req_url, "GET") end |