Monday, August 30, 2021

Perseverance pictures straight to your Gmail

Perseverance Rovers Image of Mars

Mars Perseverance Rover is at Sol 186 on Mars. Since it's landing last February 18, 2021, it already roamed 1.97 km (1.22 mi) and spent 4611 hours on an alien planet. I'm going to describe the science and the technical aspect of the Rover. Instead, I will share to you on how to capture the raw images from Mars as captured by Mars Perseverance rover's many camera.

Note: The script/code is not a gmailapp, it's a stand alone script written with Google Apps Script

NASA Open API

The images are open for public to view. Stay tune on their Mars Perseverance Multimedia site when it's published. Or, you can always get ahead using NASA Open API. Of course, we'll make use of Google Apps Script to fetch from the API. Run the code on a daily basis. Then email the images properly into our Gmail inbox. Now, that's really cool way to get those images fresh.

Sample email output

Just a caution, the script only allows upto 100 images to be embedded in the Gmail body. It's the html table with rows capped at that number. Beyond that cap, will cause an error. As a remedy, I've added a line where the full html saved into a text file, saved into a my GDrive then attach it to the email notification.

Sample gmail notification


The Script (have fun!):

No comments:

Post a Comment