Example #1
0
      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));
Example #2
0
 var get = function(deps) {
     return v.map(v.keys(deps), function(packageName) {
         return {
             packageName : packageName,
             version : deps[packageName]
         };
     }, deps);
 };
Example #3
0
 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;
     }));
 });
Example #4
0
 }, 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);
 }]);
Example #5
0
 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)
         })
     };
 };
Example #6
0
 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)
         })
     };
 };
Example #7
0
 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
     };
 };