Skip to content

Commit

Permalink
add getPhotosByUsername method
Browse files Browse the repository at this point in the history
  • Loading branch information
revall committed Jun 18, 2018
1 parent 6e009f7 commit be2c042
Show file tree
Hide file tree
Showing 2 changed files with 1,505 additions and 1,487 deletions.
18 changes: 18 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@ class Instagram {
}).then(data => data.data.reels_media)
}

async getUserIdPhotos({ id, first = 12, after = '' } = {}) {
return this.request('/graphql/query/', {
qs: {
query_hash: '6305d415e36c0a5f0abb6daba312f2dd',
variables: JSON.stringify({
id,
first,
after
})
}
}).then(data => data.data)
}

async getPhotosByUsername({ username, first, after }) {
const user = await this.getUserByUsername({ username })
return this.getUserIdPhotos({ id: user.id, first, after })
}

async getStoryItemsByUsername({ username }) {
const user = await this.getUserByUsername({ username })
return this.getStoryItemsByReel({ reelId: user.id })
Expand Down
Loading

0 comments on commit be2c042

Please sign in to comment.