- CSS 45.1%
- PHP 44%
- JavaScript 10.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| css | ||
| fonts | ||
| icon | ||
| js | ||
| .gitignore | ||
| .htaccess | ||
| index.php | ||
| README.md | ||
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.