Project

nasa

0.0
No commit activity in last 3 years
No release in over 3 years
Nasa api for ruby developers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Nasa¶ ↑

Nasa api for Ruby developers. This is not an offical project by Nasa

Installation¶ ↑

Add this line to your application’s Gemfile:

gem 'nasa'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nasa

Usage¶ ↑

You can go to Nasa’s page with the latest feeds to view them.

Recent feeds¶ ↑

To get these recent feeds :-

Nasa.get_latest_data

Pass in the number of feeds. If not then the method would fetch 10 by default.

Fetch a feed¶ ↑

Every feed has an id and if you know the id you are looking for, then :-

Nasa.search_by_id( id_you_wish_for )

There is no count here !

But, if you don’t know the id, then you can just search by its title name in hyphen and lowercased format at the same time.

Ex to create a slug: ¶ ↑

title = "Mars Map Catalog"
slug  = title.downcase.split.join('-')  =>  "mars-map-catalog"

Now you know what slug is. Awesome, send in the slug to this method and it will fetch you the dataset you were looking for.

Nasa.search_by_slug(your_slug)

Feeds belonging to a category¶ ↑

To fetch data belonging to a category to which an id is attached and you happen to know the id then pass the id to fetch that data :-

Nasa.get_category_data_by_id(id)

To fetch the feeds belonging to a particular category, heres what you should do, create a slug of that category name :-

Nasa.get_category_data_by_slug(your_slug)

In both the cases above, pass in the number of feeds. If not then the method would fetch 10 by default.

Feeds belonging to a tag¶ ↑

To fetch feeds with a particular tag and if you know the id of the tag, then :-

Nasa.get_tag_data_by_id(tag_id)

If you wish to fetch the feeds attached with a tag, then you can fetch those feeds by creating a slug of the tag name :-

Nasa.get_tag_data_by_slug(your_slug)

In both the cases above, pass in the number of feeds. If not then the method would fetch 10 by default.

Active Categories¶ ↑

To get the active categories(not the feeds, just the categories) then :-

Nasa.get_active_categories

Active Tags¶ ↑

To get the active tags(not the feeds, just the tags) then :-

Nasa.get_active_tags

That’s it. Its not a lot. Yet.

All the data you get would be in JSON format.

Contributing¶ ↑

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

Thank you !