diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-06-10 16:38:08 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-06-10 16:38:08 +0300 |
| commit | f6cfae2649a3447bee4df4d6a3e9286531a71d17 (patch) | |
| tree | 187a4e30c03899854bc6097b58638475d2a06fa1 /server/methods.js | |
| parent | 918bdef7c3c02bc33802ab094b222afd054ba08f (diff) | |
Implement instagram query by dates
Diffstat (limited to 'server/methods.js')
| -rw-r--r-- | server/methods.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/methods.js b/server/methods.js index f91546e..a177eff 100644 --- a/server/methods.js +++ b/server/methods.js @@ -1,9 +1,11 @@ Meteor.methods({ - getInstagramMedia: function () { + getInstagramMedia: function (year, month) { this.unblock(); return Meteor.http.call('GET', 'https://api.instagram.com/v1/users/self/media/recent', { 'params': { - 'access_token': Meteor.user().services.instagram.accessToken + '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), } }); } |
