var RDB = require('./redis.js'), utils = require('./utils.js'); (function(Posts) { //data structure //*global:next_post_id // *pid:1:content // *pid:1:uid // *pid:1:timestamp // ***pid:1:replies // *uid:1:posts Posts.get = function(callback, tid, start, end) { if (start == null) start = 0; if (end == null) end = start + 10; RDB.lrange('tid:' + tid + ':posts', start, end, function(pids) { var content = [], uid = [], timestamp = []; for (var i=0, ii=pids.length; i 0) { RDB.multi() .mget(content) .mget(uid) .mget(timestamp) .exec(function(err, replies) { content = replies[0]; uid = replies[1]; timestamp = replies[2]; var posts = []; for (var i=0, ii=content.length; i