Permalink
Browse files

store hosts and urls as well

  • Loading branch information...
1 parent c1f4c70 commit 0dfe616e5cd095ba3a8e34757b55892e9ea66133 @tj tj committed Dec 18, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 events.js
View
6 events.js
@@ -1,12 +1,16 @@
+var parse = require('url').parse;
var db = app.db;
/**
* Set screenshot:<id> hash.
*/
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, {
path: path,
url: url,

0 comments on commit 0dfe616

Please sign in to comment.