Skip to content

Commit

Permalink
stats
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 18, 2011
1 parent da3de53 commit dfafe67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 5 additions & 6 deletions events.js
@@ -1,22 +1,21 @@


var db = app.db;

/** /**
* Set screenshot:<id> hash. * Set screenshot:<id> hash.
*/ */


app.on('screenshot', function(path, id){ app.on('screenshot', function(path, id){
app.db.hmset('screenshot:' + id, { db.hmset('screenshot:' + id, {
path: path, path: path,
id: id id: id
}); });
}); });


/** /**
* Set screenshot:<id> hash. * Screenshot statistics.
*/ */


app.on('screenshot', function(path, id){ app.on('screenshot', function(path, id){
app.db.hmset('screenshot:' + id, { db.hincrby('screenshot:stats', 'total', 1);
path: path,
id: id
});
}); });
4 changes: 0 additions & 4 deletions routes.js
Expand Up @@ -5,10 +5,6 @@ var rasterize = require('./lib/rasterize')
, join = path.join , join = path.join
, fs = require('fs'); , fs = require('fs');


/**
* Screenshots directory.
*/

var dir = app.get('screenshots'); var dir = app.get('screenshots');


/* /*
Expand Down

0 comments on commit dfafe67

Please sign in to comment.