this.getPhotoUrl(data.photo, function(err, url) { var info; if (err) return callback(err); // normalize data info = { id: data.photo.id, title: data.photo.title._content, description: data.photo.description._content, private: !data.photo.visibility.ispublic, url: url, location: {latitude: geo.latitude, longitude: geo.longitude, accuracy: geo.accuracy}, tags: _.map(data.photo.tags.tag, function(tag){ return tag.raw; }), // TODO safety: data.photo.safety_level, license: data.photo.license, dates: data.photo.dates, exif: data.photo.exif } callback(null, info); }.bind(this));
var get = function(deps) { return v.map(v.keys(deps), function(packageName) { return { packageName : packageName, version : deps[packageName] }; }, deps); };
self._db.query('SELECT `id` FROM `tasks` WHERE `event` = ?', [eventId], function(err, tasks) { if(err) { throw err; } cb(null, v.map(tasks, function(task) { return task.id; })); });
}, function(jsons, locales, cb) { a.forEach(v.map(locales, function(locale, i) { return { locale : locale, json : JSON.stringify(jsons[i]) }; }), function(item, cb) { console.log('writing ' + item.locale + '.json'); fs.writeFile(__dirname + '/../public_html/json/templates/' + item.locale + '.json', item.json, cb); }, cb); }]);
var gather = function() { var ondemand = w.el('ondemand').attr('checked'); return { id : w.el('id').val(), repo_url : w.el('repo_url').val(), branch : w.el('branch').val(), build_instructions : v.reject(v.map(w.el('build_instructions').val().split('\n'), v.trim), v.is.emp), polling_strategy : (ondemand ? 'ondemand' : { time : parseInt(bonzo(qwery('#time')).val(), 10) }) }; };
var gather = function() { var ondemand = w.el('ondemand').attr('checked'); return { name : bonzo(qwery('#name')).val(), repo_url : bonzo(qwery('#repo_url')).val(), branch : bonzo(qwery('#branch')).val(), build_instructions : v.map(qwery('.app-build_instruction'), function(bi) { return bonzo(bi).val(); }), polling_strategy : (ondemand ? 'ondemand' : { time : parseInt(bonzo(qwery('#time')).val(), 10) }) }; };
var adapt = function(project) { var ondemand = project.polling_strategy === 'ondemand'; return { name : project.name, repo_url : project.repo_url, branch : project.branch, build_instructions : v.map(project.build_instructions, function(instruction) { return { instruction : instruction }; }), ondemand : ondemand, polling_strategy : project.polling_strategy }; };