corincerami / mars-photo-api

A Rails API for photo data from NASA's Mars Rovers
https://api.nasa.gov/#MarsPhotos
GNU General Public License v3.0
352 stars 48 forks source link

Question about the Rover API #18

Closed Orbyt closed 8 years ago

Orbyt commented 8 years ago

I noticed that for the past couple of days there hasnt been any new images released in the API, for example: https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos?earth_date=2015-12-4&api_key=DEMO_KEY

Dec 4-Dec 1 are all empty. I was wondering if this is because there were simply no images taken by the rover on those days, or is the data withheld for a bit and then released all at once at a later time?

Basically, how frequently is the database behind the API updated?

corincerami commented 8 years ago

Hey, thanks for the question. I'd like to set up the API to update more regularly, and I can totally do that, it's just a matter of cost to run the extra servers to keep gathering the data.

Orbyt commented 8 years ago

@chrisccerami So how often is it updated? Has there just not been any photos taken by the rover these past ~4 days? Or is the data just not updated in the API yet? If its the latter, how often does the API update?

corincerami commented 8 years ago

There have been some photos taken in the last few days, if you check http://mars.nasa.gov/msl/multimedia/raw/, which is the API's source of data. There currently isn't a set schedule for when it's updated, but I will look into setting one up.

Orbyt commented 8 years ago

@chrisccerami Ok interesting, im assuming that page you linked doesnt have an API, and im guessing your manually scraping the images off correct?

What is the restriction for updating daily? I can't imagine scraping 1 site daily would be costly at all?

Im building an application and wanting to display "Images taken today from the Mars rover". Obviously I cant say that if the images arent updated daily. Would rather not implement my own scraper lol.

corincerami commented 8 years ago

Yeah I think running it daily would be totally fine. I can either implement that when I get a chance, or I'm totally open to pull requests if you're able/willing to contribute.

Orbyt commented 8 years ago

@chrisccerami Ok great. I dont have much experience with Rails but I'll try and take a look through the code. How in the world is an update currently initiated though, manually? Would be great if changing an update frequency variable was all that was needed ;).

Regardless, looking into this when you get a chance would be highly appreciated.

corincerami commented 8 years ago

Sure, I'll probably have some time this weekend to set this up.

Orbyt commented 8 years ago

@chrisccerami That would be fantastic!

Was googling around and found https://github.com/javan/whenever, perhaps that would be an easy solution. Anyway, i'll check in this weekend, let me know how I can help.

corincerami commented 8 years ago

I already had the jobs set up so it was just a matter of setting a time for them to run. You should start noticing new photos already, and it should now be up to date daily. Let me know if you notice that not happening.

Orbyt commented 8 years ago

@chrisccerami I see the new ones from the last couple days, awesome. Will check back tommorrow to make sure it updates.

Orbyt commented 8 years ago

Seems to be updating fine, closed.