keycounter sqlite version

Again, source is in the SVN.
It comes with sqlite2 version and sqlite3 version. Chose the version best suits you. For example, if you want your PHP script to access the database, try sqlite2 version.

Why use sqlite?

In fact, I got a script going, it automatically update the amount of key strokes and stuff I have done.

For example, this is a client side script.

ignore_user_abort(true);
set_time_limit(0);
 
$db=sqlite_open('key.db');
//Total Mouse clicks
$query = "SELECT SUM(k1)+SUM(k2) FROM data;";
$a = sqlite_array_query($db, $query, SQLITE_NUM);
$s[] = $a[0][0];
 
//Total keystrokes
$query = "SELECT SUM(k3)+SUM(k4)+SUM(k5)+SUM(k6)+SUM(k7)+SUM(k8)+SUM(k9)+SUM(k10)+SUM(k11)+SUM(k12)+SUM(k13)+SUM(k14)+SUM(k15)+SUM(k16)+SUM(k17)+SUM(k18)+SUM(k19)+SUM(k20)+SUM(k21)+SUM(k22)+SUM(k23)+SUM(k24)+SUM(k25)+SUM(k26)+SUM(k27)+SUM(k28)+SUM(k29)+SUM(k30)+SUM(k31)+SUM(k32)+SUM(k33)+SUM(k34)+SUM(k35)+SUM(k36)+SUM(k37)+SUM(k38)+SUM(k39)+SUM(k40)+SUM(k41)+SUM(k42)+SUM(k43)+SUM(k44)+SUM(k45)+SUM(k46)+SUM(k47)+SUM(k48)+SUM(k49)+SUM(k50)+SUM(k51)+SUM(k52)+SUM(k53)+SUM(k54)+SUM(k55)+SUM(k56)+SUM(k57)+SUM(k58)+SUM(k59)+SUM(k60)+SUM(k61)+SUM(k62)+SUM(k63)+SUM(k64)+SUM(k65)+SUM(k66)+SUM(k67)+SUM(k68)+SUM(k69)+SUM(k70)+SUM(k71)+SUM(k72)+SUM(k73)+SUM(k74)+SUM(k75)+SUM(k76)+SUM(k77)+SUM(k78)+SUM(k79)+SUM(k80)+SUM(k81)+SUM(k82)+SUM(k83)+SUM(k84)+SUM(k85)+SUM(k86)+SUM(k87)+SUM(k88)+SUM(k89)+SUM(k90)+SUM(k91)+SUM(k92)+SUM(k93)+SUM(k94)+SUM(k95)+SUM(k96)+SUM(k97)+SUM(k98)+SUM(k99)+SUM(k100)+SUM(k101)+SUM(k102)+SUM(k103)+SUM(k104)+SUM(k105)+SUM(k106)+SUM(k107)+SUM(k108)+SUM(k109)+SUM(k110)+SUM(k111)+SUM(k112)+SUM(k113)+SUM(k114)+SUM(k115)+SUM(k116)+SUM(k117)+SUM(k118)+SUM(k119)+SUM(k120)+SUM(k121)+SUM(k122)+SUM(k123)+SUM(k124)+SUM(k125)+SUM(k126)+SUM(k127)+SUM(k128)+SUM(k129)+SUM(k130)+SUM(k131)+SUM(k132)+SUM(k133)+SUM(k134)+SUM(k135)+SUM(k136)+SUM(k137)+SUM(k138)+SUM(k139)+SUM(k140)+SUM(k141)+SUM(k142)+SUM(k143)+SUM(k144)+SUM(k145)+SUM(k146)+SUM(k147)+SUM(k148)+SUM(k149)+SUM(k150)+SUM(k151)+SUM(k152)+SUM(k153)+SUM(k154)+SUM(k155)+SUM(k156)+SUM(k157)+SUM(k158)+SUM(k159)+SUM(k160)+SUM(k161)+SUM(k162)+SUM(k163)+SUM(k164)+SUM(k165)+SUM(k166)+SUM(k167)+SUM(k168)+SUM(k169)+SUM(k170)+SUM(k171)+SUM(k172)+SUM(k173)+SUM(k174)+SUM(k175)+SUM(k176)+SUM(k177)+SUM(k178)+SUM(k179)+SUM(k180)+SUM(k181)+SUM(k182)+SUM(k183)+SUM(k184)+SUM(k185)+SUM(k186)+SUM(k187)+SUM(k188)+SUM(k189)+SUM(k190)+SUM(k191)+SUM(k192)+SUM(k193)+SUM(k194)+SUM(k195)+SUM(k196)+SUM(k197)+SUM(k198)+SUM(k199)+SUM(k200)+SUM(k201)+SUM(k202)+SUM(k203)+SUM(k204)+SUM(k205)+SUM(k206)+SUM(k207)+SUM(k208)+SUM(k209)+SUM(k210)+SUM(k211)+SUM(k212)+SUM(k213)+SUM(k214)+SUM(k215)+SUM(k216)+SUM(k217)+SUM(k218)+SUM(k219)+SUM(k220)+SUM(k221)+SUM(k222)+SUM(k223)+SUM(k224)+SUM(k225)+SUM(k226)+SUM(k227)+SUM(k228)+SUM(k229)+SUM(k230)+SUM(k231)+SUM(k232)+SUM(k233)+SUM(k234)+SUM(k235)+SUM(k236)+SUM(k237)+SUM(k238)+SUM(k239)+SUM(k240)+SUM(k241)+SUM(k242)+SUM(k243)+SUM(k244)+SUM(k245)+SUM(k246)+SUM(k247)+SUM(k248)+SUM(k249)+SUM(k250)+SUM(k251)+SUM(k252)+SUM(k253)+SUM(k254) FROM data;";
$a=sqlite_array_query($db, $query, SQLITE_NUM);
$s[] =$a[0][0];
 
//Total mouse moved distance
$query = "SELECT SUM(k255) FROM data;";
$a=sqlite_array_query($db, $query, SQLITE_NUM);
$s[] =$a[0][0];
 
$ch = file_get_contents('http://yoursite/key.php?s='.serialize($s));
echo $ch;
sqlite_close($db);

In the server side, you just have to unserialize the data and format it nicely, like what I did on my keycounter stat page.
You can get your computer to run that script every time the computer starts. Or you can write a bat script to execute it every so often.

Download the SQLite 2 version
Download the SQLite 3 version


Comments

Post new comment

  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <span> <fn>
  • Lines and paragraphs break automatically.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Mathematical equations and graphs can be added between [tex] and [/tex], [graph] and [/graph] tags.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
15 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
Honey Pot that kill bots