No description
  • CSS 45.1%
  • PHP 44%
  • JavaScript 10.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-02 08:10:35 +02:00
css Added live date/time update via js and made css improvments with it. 2026-07-01 20:39:47 +02:00
fonts Added css and basic gui elements. 2026-07-01 19:09:09 +02:00
icon For some reason my web server doesn't like icons. now it is icon folder. 2026-07-02 07:15:51 +02:00
js Added live date/time update via js and made css improvments with it. 2026-07-01 20:39:47 +02:00
.gitignore Made php make automatically cached api request to Nasa every 24 hours. 2026-07-01 16:51:52 +02:00
.htaccess Added .htaccess to block access to APIkeyFile + added nonCachheaders. 2026-07-01 20:00:18 +02:00
index.php For some reason my web server doesn't like icons. now it is icon folder. 2026-07-02 07:15:51 +02:00
README.md Added google font credit. 2026-07-02 08:10:35 +02:00

Some new tab

Some new tab page with Nasa daily background cosmos pictures and duckduckgo ready to search.

Host self / try it

You can see it under newtab.foxors.de. When you want to host it yourself. You just need a basic web server with PHP support. (i used php 8.4). And you HAVE to create ./data dir at top level.

Features

  • Daily cosmos background from Nasa
  • Duckduckgo search input field
  • Today's time and date

Working with the API from Nasa

The index.php asks every 24 hours the API from Nasa, with the help of an API key in API_KEY.txt. If successful it saves the response as json into ./data/persistants.json. It also directly requests the image given by the response and saves it under ./data/cachedApodImage.jpg. Furthermore it saves the unix time stamp in the json, this way it can check when 24 hours are over.

This approach keeps your API key save because everything is done on the server + you won't be blocked by Nasa because you only have one API call every 24 hours while the limit is 1000 per hour or so + the API is bit unreliable and slow (in my experience) so that we cache it will fix also that problem.

When requests fail from the server it will try next time again.

Credits

Photos are used from Nasa and sometimes also have their own licenses. The licenser is displayed in the footer of the page.

The icons are from Adwaita from the Gnome project.

Font is from fonts.google.com.