Permalink
Browse files

store url as well

  • Loading branch information...
1 parent a63d459 commit c1f4c70949ae3d2bb5a2bdc7f816c96f43e2aef0 @tj tj committed Dec 18, 2011
Showing with 4 additions and 3 deletions.
  1. +3 −2 events.js
  2. +1 −1 routes.js
View
@@ -5,10 +5,11 @@ var db = app.db;
* Set screenshot:<id> hash.
*/
-app.on('screenshot', function(path, id){
+app.on('screenshot', function(url, path, id){
db.zadd('screenshots', Date.now(), id);
db.hmset('screenshot:' + id, {
path: path,
+ url: url,
id: id
});
});
@@ -17,6 +18,6 @@ app.on('screenshot', function(path, id){
* Screenshot statistics.
*/
-app.on('screenshot', function(path, id){
+app.on('screenshot', function(url, path, id){
db.hincrby('screenshot:stats', 'total', 1);
});
View
@@ -28,7 +28,7 @@ app.get('/', function(req, res, next){
var path = join(dir, id + '.png');
rasterize(url, path, function(err){
if (err) return next(err);
- app.emit('screenshot', path, id);
+ app.emit('screenshot', url, path, id);
res.sendfile(path);
});
});

0 comments on commit c1f4c70

Please sign in to comment.