Permalink
Browse files

stats

  • Loading branch information...
1 parent da3de53 commit dfafe6719ce3fbb2c71c2f85779cb25b059f0f08 @tj tj committed Dec 18, 2011
Showing with 5 additions and 10 deletions.
  1. +5 −6 events.js
  2. +0 −4 routes.js
View
@@ -1,22 +1,21 @@
+var db = app.db;
+
/**
* Set screenshot:<id> hash.
*/
app.on('screenshot', function(path, id){
- app.db.hmset('screenshot:' + id, {
+ db.hmset('screenshot:' + id, {
path: path,
id: id
});
});
/**
- * Set screenshot:<id> hash.
+ * Screenshot statistics.
*/
app.on('screenshot', function(path, id){
- app.db.hmset('screenshot:' + id, {
- path: path,
- id: id
- });
+ db.hincrby('screenshot:stats', 'total', 1);
});
View
@@ -5,10 +5,6 @@ var rasterize = require('./lib/rasterize')
, join = path.join
, fs = require('fs');
-/**
- * Screenshots directory.
- */
-
var dir = app.get('screenshots');
/*

0 comments on commit dfafe67

Please sign in to comment.