Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pluck out photo if present on Foursquare checkin

  • Loading branch information...
commit 41ba14cff80d8af62d3fa87935a1fd6048f15b69 1 parent 9258b16
@brianshaler brianshaler authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 controllers/FoursquareController.js
View
11 controllers/FoursquareController.js
@@ -278,6 +278,17 @@ exports.controller = function(req, res, next) {
activity_item.guid = activity_item.platform + "-" + checkin.id;
activity_item.user = identity.id;
activity_item.message = message;
+ if (checkin.photos.count > 0) {
+ var image = {};
+ image.type = "photo";
+ image.sizes = [];
+ checkin.photos.items.forEach (function (photo) {
+ photo.sizes.items.forEach(function (size) {
+ image.sizes.push({url: size.url, width: size.width, height: size.height});
+ });
+ });
+ activity_item.media = [image];
+ }
activity_item.posted_at = new Date(Date.parse(checkin.createdAt));
activity_item.analyzed_at = new Date(0);
activity_item.topics = [];
Please sign in to comment.
Something went wrong with that request. Please try again.