Script Kit Logo
Script Kit
by John Lindquist
Community ScriptsDocsGuideDiscussBlog
Asep Norzai
Scripts /

Asep Norzai

nasas-astronomy-image-of-the-day

by Asep Norzai
InstallAdd to Kit.app
// Menu: NASA's Astronomy Picture of the Day
// Description: Get NASA's APOTD
// Suggested Schedule cron, run it everyday at 10AM local time: 0 10 * * *
// Author: Asep Norzai
// Twitter: @asepnorzai
import "@johnlindquist/kit"
let {data: {copyright, date, explanation, title, hdurl}} = await get(`https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY`)
show(`
<div style="padding: 1em">
<h1 style="text-align: center">Astronomy Picture of the Day</h1>
<p><strong>Title:</strong> <a href="https://apod.nasa.gov/apod/astropix.html">${title}</a></p>
<p><strong>Explanation:</strong> ${explanation}</p>
<p><strong>Date:</strong> ${date}</p>
<p><strong>Copyright:</strong> ${copyright}</p>
<image src="${hdurl}" style="margin-top: 0.5em" title="${title}"/>
</div>`,
{
title,
width: 800,
height: 1000
})
created by
John Lindquist
GitHub