page counter - thx for everyones help
Fri Apr 30 21:17:51 CEST 2010
Here is the code so far:
-export([start/0, start/1, getc/0]).
timer:apply_interval(3000, gpc, getc, ).
timer:apply_interval(Interval*1000, gpc, getc, ).
S = string:substr(
S2=list_to_integer(string:substr(S, 1, string:len(S)-10)),
So this by default gives me a page count every 3 seconds or I can put
in gpc:start(10) for 10 second intervals.
What I would like to do is take daily page counts and stick them some
where. I could make a file on the system with the date as the name
(20100430.txt) and just write the value there or I could write the
value to mnesia and keep track via the data base. I would be doing a
current count - yesterday count to get a total count for just each
day. I'm doing this so I can keep track of what the students in a
university computer lab are printing each day.
If you have any suggestions, please drop them in this list :)
I'll be experimenting anyway since I've yet to read or write to a file
with erlang on a disc or gone beyond just reading what mnesia can do
via web page info.
More information about the erlang-questions