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
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/instagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -76,6 +82,7 @@
url: null,
hash: null,
userId: null,
liked: null,
location: null,
search: null
};
Expand Down