Skip to content
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
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
<h1 align="center">
<img width="72px" src="https://firebasestorage.googleapis.com/v0/b/random-storage-332ce.appspot.com/o/instagram.svg?alt=media&token=5fe11096-daee-43c1-8d5f-8a77c9f46485">
</h1>

<p align="center">
<a href="https://www.npmjs.com/package/instagram-web-api"><img alt="NPM version" src="https://badge.fury.io/js/instagram-web-api.svg"></a>
<a href="https://circleci.com/gh/jlobos/instagram-web-api"><img alt="Build Status" src="https://circleci.com/gh/jlobos/instagram-web-api.svg?style=shield"></a>
<a href="https://github.com/sindresorhus/xo"><img alt="XO code style" src="https://img.shields.io/badge/code_style-XO-5ed9c7.svg"></a>

</p>

### A Instagram Private Web API client 🤳✨❤️
### A Next Instagram Private Web API client 🤳✨❤️

Simple, easy and very complete implementation of the Instagram private web API.

Expand Down Expand Up @@ -503,4 +492,4 @@ await client.getPhotosByHashtag({ hashtag: 'unicorn' })

## License

MIT © [Jesús Lobos](https://jlobos.com/)
MIT © [Jesús Lobos](https://jlobos.com/) & [Fskhri](https://github.com/fskhri)
7 changes: 5 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ class Instagram {
async _getSharedData(url = '/') {
return this.request(url)
.then(
html => html.split('window._sharedData = ')[1].split(';</script>')[0]
html => {
const sharedData = html.split('window._sharedData = ')[1];
return sharedData ? sharedData.split(';</script>')[0] : null;
}
)
.then(_sharedData => JSON.parse(_sharedData))
.then(_sharedData => JSON.parse(_sharedData));
}

async _getGis(path) {
Expand Down