bowshock 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.0
7
+ before_install: gem install bundler -v 2.0.1
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at joedw1978@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in bowshock.gemspec
4
+ gemspec
5
+ gem 'dotenv'
6
+ gem "down"
data/Gemfile.lock ADDED
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bowshock (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ addressable (2.6.0)
10
+ public_suffix (>= 2.0.2, < 4.0)
11
+ dotenv (2.7.0)
12
+ down (4.8.0)
13
+ addressable (~> 2.5)
14
+ minitest (5.11.3)
15
+ public_suffix (3.0.3)
16
+ rake (10.5.0)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ bowshock!
23
+ bundler (~> 2.0)
24
+ dotenv
25
+ down
26
+ minitest (~> 5.0)
27
+ rake (~> 10.0)
28
+
29
+ BUNDLED WITH
30
+ 2.0.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 javajohnhub
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Bowshock
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bowshock`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'bowshock'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install bowshock
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bowshock. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the Bowshock project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/bowshock/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "bowshock"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/bowshock.gemspec ADDED
@@ -0,0 +1,30 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "bowshock/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bowshock"
8
+ spec.version = Bowshock::VERSION
9
+ spec.authors = ["javajohnhub"]
10
+ spec.email = ["joedw1978@gmail.com"]
11
+
12
+ spec.summary = %q{Nasa Api Wrapper}
13
+ spec.description = %q{Nasa Api wrapper}
14
+ spec.homepage = "https://github.com/javajohnHub/ruby-bowshock"
15
+ spec.license = "MIT"
16
+
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+ spec.bindir = "exe"
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ["lib"]
26
+
27
+ spec.add_development_dependency "bundler", "~> 2.0"
28
+ spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "minitest", "~> 5.0"
30
+ end
data/lib/bowshock.rb ADDED
@@ -0,0 +1,102 @@
1
+ require 'dotenv'
2
+ Dotenv.load("../.env")
3
+ require_relative "bowshock/version"
4
+ require_relative "bowshock/helpers"
5
+ require_relative "bowshock/apod"
6
+ require_relative "bowshock/asterank"
7
+ require_relative "bowshock/donki"
8
+ require_relative "bowshock/earth"
9
+ require_relative "bowshock/eonet"
10
+ require_relative "bowshock/epic"
11
+ require_relative "bowshock/eva"
12
+ require_relative "bowshock/exoplanet"
13
+ require_relative "bowshock/genelab"
14
+ require_relative "bowshock/helioviewer"
15
+ module Bowshock
16
+ include Bowshock::Apod
17
+ include Bowshock::Asterank
18
+ include Bowshock::Donki
19
+ include Bowshock::Earth
20
+ include Bowshock::Eonet
21
+ include Bowshock::Epic
22
+ include Bowshock::EVA
23
+ include Bowshock::ExoPlanet
24
+ include Bowshock::GeneLab
25
+ include Bowshock::Helioviewer
26
+ end
27
+
28
+ #instance = Bowshock::Apod.apod
29
+ #instance = Bowshock::Apod.apod "2018/2/15"
30
+ #instance = Bowshock::Asterank.asterank({"query" => {"e" =>{"$lt" => 0.1},"i" => {"$lt" => 4},"a" => {"$lt" => 1.5}}, "limit" => 10})
31
+ #instance = Bowshock::Donki.CME({"startDate" => "2018/09/09"})
32
+ #instance = Bowshock::Donki.CMEA({"startDate" => "2018/09/09"})
33
+ #instance = Bowshock::Donki.GST({"startDate" => "2018/09/09"})
34
+ #instance = Bowshock::Donki.IPS({"startDate" => "2018/09/09"})
35
+ #instance = Bowshock::Donki.FLR({"startDate" => "2018/09/09"})
36
+ #instance = Bowshock::Donki.SEP({"startDate" => "2017/05/09"})
37
+ #instance = Bowshock::Donki.MPC({"startDate" => "2017/05/09"})
38
+ #instance = Bowshock::Donki.RBE({"startDate" => "2017/05/09"})
39
+ #instance = Bowshock::Donki.HSS({"startDate" => "2017/05/09"})
40
+ #instance = Bowshock::Donki.WSASim({"startDate" => "2017/05/09"})
41
+ #instance = Bowshock::Donki.notifications({"startDate" => "2017/05/09"})
42
+ # instance = Bowshock::Earth.imagery({"lon" => 100.75, "lat" => 1.5, "date" => "2014/02/04"})
43
+ #instance = Bowshock::Earth.assets({"lon" => 100.75, "lat" => 1.5, "begin" => "2014/02/01"})
44
+ #instance = Bowshock::Eonet.events({"source" => "InciWeb,EO","status" => "closed","limit" => 5, "days" => 25})
45
+ #instance = Bowshock::Eonet.categories({"id" => 8, "source" => "InciWeb,EO", "status" => "open","limit" => 5, "days" => 25})
46
+ #instance = Bowshock::Eonet.sources()
47
+ #instance = Bowshock::Epic.natural()
48
+ #instance = Bowshock::Epic.naturalAll()
49
+ #instance = Bowshock::Epic.naturalDate("2018/12/12")
50
+ #instance = Bowshock::Epic.naturalAvailable()
51
+ #instance = Bowshock::Epic.enhanced()
52
+ #instance = Bowshock::Epic.enhancedAll()
53
+ #instance = Bowshock::Epic.enhancedDate("2018/12/12")
54
+ #instance = Bowshock::Epic.enhancedAvailable()
55
+ #instance = Bowshock::EVA.eva()
56
+ #instance = Bowshock::ExoPlanet.allConfirmedPlanetsAndCols()
57
+ #instance = Bowshock::ExoPlanet.confirmedPlanetsInKeplerField()
58
+ #instance = Bowshock::ExoPlanet.starsKnownToHostExoPlanets()
59
+ #instance = Bowshock::ExoPlanet.confirmedPlanetsThatTransitHostStars()
60
+ #instance = Bowshock::ExoPlanet.currentNonConfirmedPlanetCandidates()
61
+ #instance = Bowshock::ExoPlanet.k2TargetsFromCapaign9()
62
+ #instance = Bowshock::ExoPlanet.confirmedPlanetsInMissionStarList()
63
+ #instance = Bowshock::ExoPlanet.getSingleKOI('K00007.01')
64
+ #instance = Bowshock::ExoPlanet.allMicrolensingPlanetsWithTimeSeries()
65
+ #instance = Bowshock::ExoPlanet.allPlanetaryCandidatesSmallerThan2ReWithEquilibriumTemperaturesBetween180and303K()
66
+ #instance = Bowshock::GeneLab.search({"type" =>"cgene", "term" => "a"})
67
+ #instance = Bowshock::GeneLab.htmlSearch({"query" =>"cgene", "data_source" => "a"})
68
+ #instance = Bowshock::Helioviewer.getjp2image({"date" => "2014-01-01T23:59:59", "sourceId" => 14})
69
+ #instance = Bowshock::Helioviewer.getjp2header(17654321)
70
+ #instance = Bowshock::Helioviewer.getJPX({"startTime" => "2014-01-01T00:00:00", "endTime" => "2014-01-01T00:45:00" , "sourceId" => 14, "cadence" => 12})
71
+ #instance = Bowshock::Helioviewer.getJPXClosestToMidPoint({"startTimes" => [1306886400,1306887000,1306887600], "endTimes" => [1306886700,1306887300,1306887900] , "sourceId" => 14, "linked" => true});
72
+ =begin
73
+ instance = Bowshock::Helioviewer.queueMovie({"startTime" => "2010-03-01T12:12:12",
74
+ "endTime" => "2010-03-04T12:12:12",
75
+ "layers" => "[3,1,100],[4,1,100]",
76
+ "events" => "[AR,HMI_HARP;,SPoCA,1],[CH,all,1]",
77
+ "eventsLabels" => false,
78
+ "imageScale" => 21.04,
79
+ "format" => "mp4",
80
+ "frameRate" => 15,
81
+ "maxFrames" => 300,
82
+ "scale" => true,
83
+ "scaleType" => "earth",
84
+ "scaleX" => -1000,
85
+ "scaleY" => -500,
86
+ "movieLength" => 4.3333,
87
+ "watermark" => true,
88
+ "width" => 1920,
89
+ "height" => 1200,
90
+ "x0" => 0,
91
+ "y0" => 0,
92
+ "x1" => -5000,
93
+ "y1" => -5000,
94
+ "x2" => 5000,
95
+ "y2" => 5000,
96
+ #callback: "Wrap the response object in a function call of your choosing."
97
+ })
98
+ =end
99
+ #instance = Bowshock::Helioviewer.reQueueMovie("VXvX5")
100
+ #instance = Bowshock::Helioviewer.getMovieStatus({"id" => "F3Dh5", "format" => "mp4", "verbose" => true, #"callback" => "callback", #"token" => "4673d6db4e2a3365ab361267f2a9a112"})
101
+ #instance = Bowshock::Helioviewer.downloadMovie({"id" => "VXvX5", "format" => "mp4", "hq" => true})
102
+ #puts instance
@@ -0,0 +1,26 @@
1
+ require_relative "helpers"
2
+ module Bowshock
3
+
4
+ module Apod
5
+
6
+ def apod(date = nil, concept_tags = nil)
7
+ base_url = "https://api.nasa.gov/planetary/apod?"
8
+
9
+ if date
10
+ Helpers.vali_date date
11
+ base_url += "date=" + date + "&"
12
+ end
13
+
14
+ if concept_tags
15
+ base_url += "concept_tags=#{concept_tags}" + "&"
16
+ end
17
+
18
+ req_url = base_url + "api_key=#{Helpers.nasa_api_key}"
19
+
20
+ Helpers.getJson(req_url, 'GET')
21
+
22
+ end
23
+
24
+ module_function :apod
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ require 'json'
2
+
3
+ module Bowshock
4
+ module Asterank
5
+ def asterank(object)
6
+
7
+ base_url = "http://www.asterank.com/api/asterank?"
8
+ if object["query"]
9
+ base_url += "query=#{object["query"].to_json.to_s}&"
10
+ end
11
+
12
+ if object["limit"]
13
+ base_url += "limit=#{object["limit"].to_s}"
14
+ end
15
+
16
+ Helpers.getJson(base_url, 'GET')
17
+
18
+ end
19
+
20
+ module_function :asterank
21
+ end
22
+ end
@@ -0,0 +1,186 @@
1
+ module Bowshock
2
+ module Donki
3
+ def CME(object)
4
+ base_url = "https://api.nasa.gov/DONKI/CME?"
5
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
6
+
7
+ if object["endDate"]
8
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
9
+ end
10
+
11
+ base_url += "api_key=#{Helpers.nasa_api_key}"
12
+ Helpers.getJson(base_url, "GET")
13
+ end
14
+
15
+ module_function :CME
16
+
17
+ def CMEA(object)
18
+ base_url = "https://api.nasa.gov/DONKI/CMEAnalysis?"
19
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
20
+
21
+ if object["endDate"]
22
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
23
+ end
24
+ if object["mostAccurateOnly"]
25
+ base_url += "mostAccurateOnly=#{object["mostAccurateOnly"]}&"
26
+ end
27
+ if object["completeEntryOnly"]
28
+ base_url += "completeEntryOnly=#{object["completeEntryOnly"]}&"
29
+ end
30
+ if object["speed"]
31
+ base_url += "speed=#{object["speed"]}&"
32
+ end
33
+ if object["halfAngle"]
34
+ base_url += "halfAngle=#{object["halfAngle"]}&"
35
+ end
36
+ if object["catalog"]
37
+ base_url += "catalog=#{object["catalog"]}&"
38
+ end
39
+ if object["keyword"]
40
+ base_url += "keyword=#{object["keyword"]}&"
41
+ end
42
+
43
+ base_url += "api_key=#{Helpers.nasa_api_key}"
44
+ Helpers.getJson(base_url, "GET")
45
+ end
46
+
47
+ module_function :CMEA
48
+
49
+ def GST(object)
50
+ base_url = "https://api.nasa.gov/DONKI/GST?"
51
+ base_url += "startDate=#{Helpers::vali_date(object["startDate"])}&"
52
+
53
+ if object["endDate"]
54
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
55
+ end
56
+
57
+ base_url += "api_key=#{Helpers.nasa_api_key}"
58
+ Helpers.getJson(base_url, "GET")
59
+ end
60
+
61
+ module_function :GST
62
+
63
+ def IPS(object)
64
+ base_url = "https://api.nasa.gov/DONKI/IPS?"
65
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
66
+
67
+ if object["endDate"]
68
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
69
+ end
70
+ if object["location"]
71
+ base_url += "location=#{object["location"]}&"
72
+ end
73
+ if object["catalog"]
74
+ base_url += "catalog=#{object["catalog"]}&"
75
+ end
76
+
77
+ base_url += "api_key=#{Helpers.nasa_api_key}"
78
+ Helpers.getJson(base_url, "GET")
79
+ end
80
+
81
+ module_function :IPS
82
+
83
+ def FLR(object)
84
+ base_url = "https://api.nasa.gov/DONKI/FLR?"
85
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
86
+
87
+ if object["endDate"]
88
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
89
+ end
90
+
91
+ base_url += "api_key=#{Helpers::nasa_api_key}"
92
+ Helpers.getJson(base_url, "GET")
93
+
94
+ end
95
+
96
+ module_function :FLR
97
+
98
+ def SEP(object)
99
+ base_url = "https://api.nasa.gov/DONKI/SEP?"
100
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
101
+
102
+ if object["endDate"]
103
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
104
+ end
105
+
106
+ base_url += "api_key=#{Helpers.nasa_api_key}"
107
+ Helpers.getJson(base_url, "GET")
108
+ end
109
+
110
+ module_function :SEP
111
+
112
+ def MPC(object)
113
+ base_url = "https://api.nasa.gov/DONKI/MPC?"
114
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
115
+
116
+ if object["endDate"]
117
+ base_url += "endDate=#{Helpers.vali_date(object.endDate)}&"
118
+ end
119
+
120
+ base_url += "api_key=#{Helpers.nasa_api_key}"
121
+ Helpers.getJson(base_url, "GET");
122
+ end
123
+
124
+ module_function :MPC
125
+
126
+ def RBE(object)
127
+ base_url = "https://api.nasa.gov/DONKI/RBE?"
128
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
129
+
130
+ if object["endDate"]
131
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
132
+ end
133
+
134
+ base_url += "api_key=#{Helpers.nasa_api_key}"
135
+ Helpers.getJson(base_url, "GET")
136
+ end
137
+
138
+ module_function :RBE
139
+
140
+ def HSS(object)
141
+ base_url = "https://api.nasa.gov/DONKI/HSS?"
142
+
143
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
144
+ if object["endDate"]
145
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
146
+ end
147
+
148
+ base_url += "api_key=#{Helpers.nasa_api_key}"
149
+ Helpers.getJson(base_url, "GET")
150
+ end
151
+
152
+ module_function :HSS
153
+
154
+ def WSASim(object)
155
+ base_url = "https://api.nasa.gov/DONKI/WSAEnlilSimulations?"
156
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
157
+
158
+ if object["endDate"]
159
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
160
+ end
161
+
162
+ base_url += "api_key=#{Helpers.nasa_api_key}"
163
+ Helpers.getJson(base_url, "GET");
164
+ end
165
+
166
+ module_function :WSASim
167
+
168
+ def notifications(object)
169
+ base_url = "https://api.nasa.gov/DONKI/notifications?"
170
+ base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
171
+
172
+ if object["endDate"]
173
+ base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
174
+ end
175
+
176
+ if object["type"]
177
+ base_url += "type=#{object["type"]}&"
178
+ end
179
+
180
+ base_url += "api_key=#{Helpers.nasa_api_key}"
181
+ Helpers.getJson(base_url, "GET")
182
+ end
183
+
184
+ module_function :notifications
185
+ end
186
+ end