~terry
Sun, Feb 9, 1997 (20:01)
seed
Scripts.
~terry
Sun, Feb 9, 1997 (20:02)
#1
#1 of 1: More Doctor Who than Doctor Dre (cromis) Wed Jan 15 '97 (21:25)
78 lines
Well, this doesn't seem like a popular topic :-)
... but it seems the right place for something I thought a few people might
be interested in - two little gadgets for auto-updating web pages with
either a time stamp or a login counter, although there are probably other
wyas you could use them.
timestamp and logincounter both work by searching for a comment looking like
this
or this
in the supplied inputfile, (writing the file as they go into outputfile),
and when they find one of those comments, they replace the ENTIRE LINE with
something like this:
16/01/97
or this
167
so that when your page is viewed just the bit between the comments will be
seen. It'll do this for every occurrence of them in your supplied file,
which in the case of logincounter will increment the count repeatedly so
don't do it. Usage is:
timestamp -switch inputfile outputfile
where -switch can be
-t Stamp time (hh:mm:ss) only
-T Stamp time (hh:mm) only
-d Stamp date (dd/mm/yy) only UK-style
-D Stamp date (mm/dd/yy) US-style
-b Stamp both date (dd/mm/yy) and time (hh:mm) with a space between
-B Stamp both date (mm/dd/yy) and time (hh:mm) with a space between
and
logincounter inputfile outputfile
in the directory where a file .logincounter exists and has an integer on the
first line (like the .counter file, but probably best to put it in your home
directory)
Or just invoke them without arguments for instructions.
If you just want to have a timestamp and/or a logincounter without worrying
about all that that will update every time you log in, add the relevant
lines like this:
I last logged in at
and that makes it
times since I put in the counter.
to the file you want updating, and then edit your .profile, adding the
following lines to the end:
timestamp -B WEB/mypage.html WEB/mypage.new
mv WEB/mypage.new WEB/mypage.html
logincounter WEB/mypage.html WEB/mypage.new
mv WEB/mypage.new WEB/mypage.html
chmod 644 WEB/mypage.html
where WEB/mypage.html is the page to update, and -B is the type of timestamp
you want. Then create a file .logincounter in your home directory with just
the character 1 (or whatever number you want to start at) in it, and then
copy the files from my directory like this:
cp ~cromis/logincounter .
cp ~cromis/timestamp .
and bob's yer uncle, instant (minor) neat trick. (I don't know if you need
to have . in your PATH to do tha, but perhaps some UNIX genius can tell me
that)
If you want the source type
cp ~cromis/source/*.c .
Do what you like with them; if you have any problems email me, although you
use them at your own risk. (it's 5:30am here so I'm a little tired :-)
Note also that if you have any lines that are more than 5000 characters in
your file it will truncate them to 5000 so watch it, all you people you like
to string your entire page onto one line.
Thanks!
~spring
Fri, Jan 28, 2005 (08:20)
#2
http://www.dynamicdrive.com/dynamicindex9/
Have scripts that keep browsers from copying images. When they right click on a page to highlight text or copy an image, nothing happens.
Check it out!
Go to this page and try to copy some text or an image.
http://spring.net/noclick