From 01dc802401e6fcca82ecf663fcbbdfb642c14b1c Mon Sep 17 00:00:00 2001 From: Fakhri Djuanda <41115223+fskhri@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:26:45 +0700 Subject: [PATCH 1/5] Fix Cannot read properties of undefined (reading 'split') --- lib/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 9060571..03a5c79 100644 --- a/lib/index.js +++ b/lib/index.js @@ -106,9 +106,12 @@ class Instagram { async _getSharedData(url = '/') { return this.request(url) .then( - html => html.split('window._sharedData = ')[1].split(';')[0] + html => { + const sharedData = html.split('window._sharedData = ')[1]; + return sharedData ? sharedData.split(';')[0] : null; + } ) - .then(_sharedData => JSON.parse(_sharedData)) + .then(_sharedData => JSON.parse(_sharedData)); } async _getGis(path) { From 290f9039d84f651d3ea85aaa09c41e7dde240ebc Mon Sep 17 00:00:00 2001 From: Fakhri Djuanda <41115223+fskhri@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:54:18 +0700 Subject: [PATCH 2/5] Update README.md --- README.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/README.md b/README.md index 4376363..4c05b0f 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,4 @@ -

- -

- -

- NPM version - Build Status - XO code style - -

- -### A Instagram Private Web API client 🤳✨❤️ +### A Instagram Next Private Web API client 🤳✨❤️ Simple, easy and very complete implementation of the Instagram private web API. From ebae2b62c9d609fc2367a65ad3073151cf0c2ca0 Mon Sep 17 00:00:00 2001 From: Fakhri Djuanda <41115223+fskhri@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:54:41 +0700 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c05b0f..294c9e4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -### A Instagram Next Private Web API client 🤳✨❤️ +### A Next Instagram Private Web API client 🤳✨❤️ Simple, easy and very complete implementation of the Instagram private web API. From e7aee9bfd7abc45b9267e9683e8e9f496943e106 Mon Sep 17 00:00:00 2001 From: Fakhri Djuanda <41115223+fskhri@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:56:16 +0700 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 294c9e4..d5eaf35 100644 --- a/README.md +++ b/README.md @@ -492,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) From f5ecabb1efc299d83643a1dd970fe409d8bf6016 Mon Sep 17 00:00:00 2001 From: Fakhri Djuanda <41115223+fskhri@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:58:03 +0700 Subject: [PATCH 5/5] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..0049296 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -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}}