summaryrefslogtreecommitdiff
path: root/server/methods.js
blob: 8f6cc52a2d7baa353f024579e66b578b7bb8f6bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Meteor.methods({
  getInstagramMedia: function (year, month) {
    this.unblock();
    return HTTP.get('https://api.instagram.com/v1/users/self/media/recent', {
      'params': {
        'access_token': Meteor.user().services.instagram.accessToken,
        'min_timestamp': Math.round(Date.UTC(month==1?year-1:year, month==1?12:month-1) / 1000),
        'max_timestamp': Math.round(Date.UTC(year, month) / 1000),
      }
    });
  },
  getInstagramProfilePhoto: function () {
    return Meteor.user().services.instagram.profile_picture;
  },
  printFinalImage: function(code) {
    if (Meteor.userId()) {
      var username = Meteor.user().services.instagram.username;
      console.log('Printing', username + '|' + code);
    }
  }
});