Skip to content

Commit

Permalink
Fix getHome to graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
aldinp16 authored and revall committed May 20, 2020
1 parent 6bb9d9c commit bdae6ab
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,23 @@ class Instagram {
}

// https://github.com/jlobos/instagram-web-api/issues/23
async getHome() {
return this.request('/?__a=1').then(data => data.graphql.user)
async _getHomeData({ queryHash, variables }) {
return this.request('/graphql/query/', {
qs: {
query_hash: queryHash,
variables: JSON.stringify(variables)
}
}).then(data => data)
}

// https://github.com/jlobos/instagram-web-api/issues/23
async getHome(mediaItemCursor) {
return this._getHomeData({
queryHash: '01b3ccff4136c4adf5e67e1dd7eab68d',
variables: {
fetch_media_item_cursor: mediaItemCursor
}
})
}

async getUserByUsername({ username }) {
Expand Down

0 comments on commit bdae6ab

Please sign in to comment.