summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorYuval Adam <yuval@y3xz.com>2015-06-10 16:38:08 +0300
committerYuval Adam <yuval@y3xz.com>2015-06-10 16:38:08 +0300
commitf6cfae2649a3447bee4df4d6a3e9286531a71d17 (patch)
tree187a4e30c03899854bc6097b58638475d2a06fa1 /server
parent918bdef7c3c02bc33802ab094b222afd054ba08f (diff)
Implement instagram query by dates
Diffstat (limited to 'server')
-rw-r--r--server/methods.js6
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),
}
});
}