Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Adding users/self/media/liked #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adding users/self/media/liked
tobystokes committed Jul 17, 2015
commit dcf41c36a390fb6270675a4ccda30682f265dce1
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -129,6 +129,18 @@ Parameters:
* `max_timestamp` A unix timestamp. All media returned will be taken earlier than this timestamp.
* `distance` Default is 1km (`distance` = 1000), max distance is 5km.

#### liked

Get media 'liked' by the current authenticated user.

See https://instagram.com/developer/endpoints/users/#get_users_feed_liked

Authentication: `accessToken` required.

Type: `String`

Default: `null`

#### accessToken

OAuth 2 access token.
11 changes: 9 additions & 2 deletions dist/instagram.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! jQuery Instagram - v0.3.1 - 2014-06-19
/*! jQuery Instagram - v0.3.1 - 2015-07-17
* http://potomak.github.com/jquery-instagram
* Copyright (c) 2014 Giovanni Cappellotto; Licensed MIT */
* Copyright (c) 2015 Giovanni Cappellotto; Licensed MIT */
(function($) {

function composeRequest(options) {
@@ -27,6 +27,12 @@
url += '/media/search';
data = $.extend(data, options.search);
}
else if (options.liked != null) {
if (options.accessToken == null) {
throw 'You must provide an access token';
}
url += '/users/self/media/liked';
}
else if (options.userId != null) {
if (options.accessToken == null) {
throw 'You must provide an access token';
@@ -71,6 +77,7 @@
url: null,
hash: null,
userId: null,
liked: null,
location: null,
search: null
};
6 changes: 3 additions & 3 deletions dist/instagram.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@
"test": "grunt qunit"
},
"devDependencies": {
"grunt-contrib-jshint": "~0.6.0",
"grunt-contrib-qunit": "~0.2.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.4.0",
"grunt-contrib-clean": "~0.4.0",
"grunt": "~0.4.1"
"grunt-contrib-jshint": "~0.11.2",
"grunt-contrib-qunit": "~0.7.0",
"grunt-contrib-concat": "~0.5.1",
"grunt-contrib-uglify": "~0.9.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-clean": "~0.6.0",
"grunt": "~0.4.5"
}
}
7 changes: 7 additions & 0 deletions src/instagram.js
Original file line number Diff line number Diff line change
@@ -32,6 +32,12 @@
url += '/media/search';
data = $.extend(data, options.search);
}
else if (options.liked != null) {
if (options.accessToken == null) {
throw 'You must provide an access token';
}
url += '/users/self/media/liked';
}
else if (options.userId != null) {
if (options.accessToken == null) {
throw 'You must provide an access token';
@@ -76,6 +82,7 @@
url: null,
hash: null,
userId: null,
liked: null,
location: null,
search: null
};