Skip to content

Commit

Permalink
store hosts and urls as well
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 18, 2011
1 parent c1f4c70 commit 0dfe616
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion events.js
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,16 @@


var parse = require('url').parse;
var db = app.db; var db = app.db;


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


app.on('screenshot', function(url, path, id){ app.on('screenshot', function(url, path, id){
db.zadd('screenshots', Date.now(), id); var now = Date.now();
db.zadd('screenshot:ids', now, id);
db.zadd('screenshot:urls', now, url);
db.zadd('screenshot:hosts', now, parse(url).host);
db.hmset('screenshot:' + id, { db.hmset('screenshot:' + id, {
path: path, path: path,
url: url, url: url,
Expand Down

0 comments on commit 0dfe616

Please sign in to comment.