Timezone Clock is a website setup for dual timezone clock with weather informations compatible with legacy browsers.
- Compatible with legacy browsers;
- Scaled UI with browser window's size;
- Flexible JSON request proxy for centralised request to API source;
- Can be used with a free subscription of OpenWeatherMap;
The website can be hosted on a PHP server (detects .html and .php as PHP files) or used on client side (no setup required), it is compatible and will auto detect how it is used. However, there is no rate limit on client side, request limit imposed by OpenWeatherMap may be exceeded and causes error, but as long as you limit the times you refresh or change location, client side will be fine.
Use setup.sh to setup. For Bash, Apache and SQLite3 on Linux.
Modification will be needed for other shells, server hosting programs or operating systems.
Create scripts/php.ini
file with OPENWEATHERMAP_APPID=[your id here]
in it.
Server should be pointing to the parent directory and index.html, php.ini file must have restricted access.
Remove the following files before starting a public server:
- .git
- .gitignore
- README.md
- screenshot.png
- screenshot-menu.png
- setup.sh
For for other shells, server hosting programs or operating systems, here is a summary of the setup script, variables are in square brackets:
- Remove
scripts/apijson.sqlite3
- Create SQLite3 database
scripts/apijson.sqlite3
with table namedResponse
, with columnsLocation TEXT PRIMARY KEY NOT NULL
,Json TEXT NOT NULL
andRequestTime INTEGER NOT NULL
- Change all files' permission to
664 (-rw-rw-r--)
, directories' permission to775 (drwxrwxr-x)
(See Wikipedia for notation explanation) - Change permission of
setup.sh
to775 (-rwxrwxr-x)
for future execution - Detect the user group of web server (For Apache on Linux, it is
http
by default and found afterGroup
keyword in/etc/httpd/conf/httpd.conf
) - Change owner to
[self username]:[web server group]
for all items in the repository directory and parent directories up to the one before root (For example,wylie
in default Linux Apache environment with repository of path/home/repos/timezone-clock
;repos
,timezone-clock
and everything intimezone-clock
will have the owner ofwylie:http
) - Change the permission of the repository directory and parent directories up to the one before root to
775 (drwxrwxr-x)