Skip to content

Commit

Permalink
Add getPrivateProfilesFollowRequests based on PR#65
Browse files Browse the repository at this point in the history
  • Loading branch information
revall committed May 19, 2020
1 parent af888f9 commit 5e60f1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Instagram {

// Temporary work around for https://github.com/jlobos/instagram-web-api/issues/118
const createEncPassword = pwd => {
return `#PWD_INSTAGRAM_BROWSER:0:${Date.now()}:${pwd}`;
return `#PWD_INSTAGRAM_BROWSER:0:${Date.now()}:${pwd}`
}

// Login
Expand Down Expand Up @@ -490,9 +490,11 @@ class Instagram {
}

async getPrivateProfilesFollowRequests(cursor) {
return this.request('accounts/access_tool/current_follow_requests?__a=1' + (cursor!==null ? `&cursor=${cursor}`: ''))
const cursorParam = cursor ? `&cursor=${cursor}` : ''
return this.request(
`accounts/access_tool/current_follow_requests?__a=1${cursorParam}`
)
}
}


module.exports = Instagram
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,8 @@ test('getPhotosByHashtag', async t => {
const { status } = await client.search({ hashtag: 'Instagram' })
t.is(status, 'ok')
})

test('getPrivateProfilesFollowRequests', async t => {
const { page_name } = await client.getPrivateProfilesFollowRequests()
t.is(page_name, 'current_follow_requests')
})

0 comments on commit 5e60f1b

Please sign in to comment.