asterank-ruby¶ ↑
A module for using the Asterank
APIs. Sponsored by Space Apps PR.
The Asterank
, MPC and Kepler APIs accepts queries that adhere to mongo’s json format for a ‘find’ operation. This gem leverages mongoid’s origin gem to construct these queries.
Asterank API | MPC API | Kepler API | Skymorph API.
Install¶ ↑
Via rubygems.org:
gem install asterank-ruby
Getting Started¶ ↑
Setup Work¶ ↑
require 'asterank-ruby' # set up a client to talk to the Asterank APIs @client = Asterank::Client.new
Query Asterank
API¶ ↑
results = @client.asterank.lt(e: 0.1, i: 4, a: 4).limit(10).execute
Query MPC API¶ ↑
results = @client.mpc.lt(e: 0.1, i: 4, a: 4).limit(10).execute
Query Kepler API¶ ↑
results = @client.kepler.lt(TPLANET:320).gt(TPLANET:290).limit(10).execute
Query Skymorph API¶ ↑
target = "J99TS7A" query = @client.skymorph.search(target) result = query["results"].first # Write Image to Disk key = result["key"] @client.skymorph.image(key, "filename.jpg", false) # fast image false File.open('filename.jpg') $ #<File:filename.jpg>
More Information¶ ↑
These gems borrows heavily from the twilio-ruby gem in documentation and code design.