"Last updated on...."
One of the things which many people put on their websites, but always seem to forget to update, is a line of text saying when that page was last updated. There is a way of using JavaScript to write in the relevant line, but that's complicated, and won't work on older browsers.
However, you can now use a CGI (a web-based program) which will return an image telling you when a specified page was last updated, because it can ask the web server for the datestamp of that file.
This script can be accessed by using the following bit of HTML:
<img src="/cgi-bin /lastupdate">
However, without passing it any data it won't be of much use to you - it's got to fetch a web page to work, otherwise it will complain that it is Unable to fetch page!
The following are parameters which you can pass to the program - the URL is always required, but the other fields are optional.
url The FULL ADDRESS of the page to be checked - for instance, http://paul.orpheusweb.co.uk/index.html
(substitute the paul part to get your own homepage)
example: | <img src="/cgi-bin /lastupdate
?url=http://paul.orpheusweb.co.uk/index.html"> |
returns: |
|
colour Although the default colour is black, there are 24 colours to choose from - essentially the same as those used for Orpheus' counter. Only the text colour is changed, the background is always transparent.
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
In additional, the eight main colours can be called by name:
black |
red |
green |
yellow |
blue |
cyan |
magenta |
white |
example: | <img src="/cgi-bin /lastupdate
?url=http://paul.orpheusweb.co.uk/index.html
&colour=blue">
|
or: | <img src="/cgi-bin /lastupdate
?url=http://paul.orpheusweb.co.uk/index.html
&colour=4">
|
both return: | |
bold
The default font is quite thin, but if you have quite a strong background colour this might not show up very well. In this case you could try adding the bold attribute - available in two versions, as well as off:
bold= | Meaning |
0 | off - you don't actually have to use this |
1 (or true) | on - text has double thickness |
2 | double thickness in both height and depth |
example: | <img src="/cgi-bin /lastupdate
?url=http://paul.orpheusweb.co.uk/index.html
&bold=0">
|
returns: | |
example: | <img src="/cgi-bin /lastupdate
?url=http://paul.orpheusweb.co.uk/index.html
&bold=1">
|
returns: | |
example: | <img src="/cgi-bin /lastupdate
?url=http://paul.orpheusweb.co.uk/index.html
&bold=2">
|
returns: | |
format
It may be that, for your website, the standard format of day, date, month and year is too long, or that you can't get image to align properly with some sort of "Last updated on..." text; the format attribute allows you some control over what format the date is output in:
Numeric | Textual | Meaning |
0 | | off - you don't actually have to use this |
1 | long, or verbose | adds the words "Last updated on" to the start |
2 | short | outputs in the format xx/Mon/yy |
example: | <img src="/cgi-bin /lastupdate
?url=http://paul.orpheusweb.co.uk/index.html
&format=1">
|
returns: | |
example: | <img src="/cgi-bin /lastupdate
?url=http://paul.orpheusweb.co.uk/index.html
&format=2">
|
returns: | |
Final example
If you put all that together you might get...
example: | <img src="/cgi-bin
/lastupdate
?url=http://paul.orpheusweb.co.uk/index.html
&colour=white
&bold=2
&format=verbose">
|
returns: | |
Final notes
It should be noted that, although the image returned is always 16 pixels high, you should never give the image a width attribute (e.g. <img src="..." width="100"...> because it may be different every time - it depends on the date.
You may have guessed that, because you enter the full URL of the page you want to check, it doesn't have to be on your website at all - in fact, you can even use this program to check webpages that aren't even hosted by ArgoNet. However, not all servers return the necessary information needed by this program so it won't always work, and by fetching pages from another server you will slow down the image loading on your page.
Don't panic!
Don't panic if you add the necessary code only to find the image doesn't appear - you will not be able to see the graphic unless you are actually connected to the Internet, as the program necessary to run it is located on our server.
Additional Support
Computer Systems
Game Consoles |
|