From 74571c3f0092e13cc7afd05d13218bfc534f66da Mon Sep 17 00:00:00 2001 From: Pavol Hejny Date: Sat, 16 Sep 2023 00:29:18 +0200 Subject: [PATCH 01/55] Draft --- src/pages/new/from-instagram.tsx | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/pages/new/from-instagram.tsx diff --git a/src/pages/new/from-instagram.tsx b/src/pages/new/from-instagram.tsx new file mode 100644 index 000000000..f9bead9c3 --- /dev/null +++ b/src/pages/new/from-instagram.tsx @@ -0,0 +1,51 @@ +import { useState } from 'react'; +import { StaticAppHead } from '../../components/AppHead/StaticAppHead'; +import { Center } from '../../components/Center/Center'; +import styles from '../../styles/static.module.css' /* <- TODO: [🤶] Get rid of page css and only use components (as ) */; +import { string_url } from '../../utils/typeAliases'; +import { isValidUrl } from '../../utils/validators/isValidUrl'; + +export default function NewWallpaperFromInstagramPage() { + const [url, setUrl] = useState(null); + + return ( + <> + + +
+
+
+

AI Web Maker

+ Write URL to make new web from: + setUrl(event.target.value)} + /> + +
+
+ + {/* TODO: Make here some footer +
+ +
+ */} +
+ + ); +} + +/** + * TODO: [👐] Unite design of all /new/* pages + * TODO: !!! Implement + */ From 2165fbe25dfe534d8328c57fecbbbcad5e5d92a1 Mon Sep 17 00:00:00 2001 From: Pavol Hejny Date: Sat, 16 Sep 2023 00:32:23 +0200 Subject: [PATCH 02/55] Scenarios --- src/components/GraphsAsScenarios/GraphsAsScenarios.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/GraphsAsScenarios/GraphsAsScenarios.tsx b/src/components/GraphsAsScenarios/GraphsAsScenarios.tsx index 0b29ba6a5..637b5f757 100644 --- a/src/components/GraphsAsScenarios/GraphsAsScenarios.tsx +++ b/src/components/GraphsAsScenarios/GraphsAsScenarios.tsx @@ -31,6 +31,14 @@ export function GraphsAsScenarios() { To upload and generate your website +
  • + + +

    Instagram

    + profile to generate your website +
    + +
  • ); } From 77533150ce71b9f79ab159b3947f486a428950f1 Mon Sep 17 00:00:00 2001 From: Pavol Hejny Date: Sat, 16 Sep 2023 16:34:03 +0200 Subject: [PATCH 03/55] Instagram fetcher --- package-lock.json | 126 +++++++++++++++++++++++++++++++ package.json | 1 + src/pages/new/from-image.tsx | 1 + src/pages/new/from-instagram.tsx | 23 +++--- src/pages/new/from-prompt.tsx | 4 + 5 files changed, 142 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 89df29278..344951556 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "file-saver": "2.0.5", "formidable": "3.5.0", "html-react-parser": "3.0.12", + "insta-fetcher": "^1.3.26", "isomorphic-fetch": "3.0.0", "jszip": "3.10.1", "lodash": "4.17.21", @@ -5088,6 +5089,28 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -5392,6 +5415,14 @@ "tweetnacl": "^0.14.3" } }, + "node_modules/big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "engines": { + "node": ">=0.6" + } + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -8169,6 +8200,25 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -9201,6 +9251,29 @@ "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" }, + "node_modules/insta-fetcher": { + "version": "1.3.26", + "resolved": "https://registry.npmjs.org/insta-fetcher/-/insta-fetcher-1.3.26.tgz", + "integrity": "sha512-KtmUaClyn2ekNJDT8TycYiOr49a+DAZVJ4AIPPhgraUygbeqUsg02EcfIBIUxh7e9uhlzLohLS2j4Me3pOZpdg==", + "dependencies": { + "axios": "^0.27.2", + "big-integer": "^1.6.51", + "form-data": "^4.0.0" + } + }, + "node_modules/insta-fetcher/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", @@ -19907,6 +19980,27 @@ "integrity": "sha512-9l850jDDPnKq48nbad8SiEelCv4OrUWrKab/cPj0GScVg6cb6NbCCt/Ulk26QEq5jP9NnGr04Bit1BHyV6r5CQ==", "dev": true }, + "axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "requires": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -20119,6 +20213,11 @@ "tweetnacl": "^0.14.3" } }, + "big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" + }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -22201,6 +22300,11 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -22971,6 +23075,28 @@ "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" }, + "insta-fetcher": { + "version": "1.3.26", + "resolved": "https://registry.npmjs.org/insta-fetcher/-/insta-fetcher-1.3.26.tgz", + "integrity": "sha512-KtmUaClyn2ekNJDT8TycYiOr49a+DAZVJ4AIPPhgraUygbeqUsg02EcfIBIUxh7e9uhlzLohLS2j4Me3pOZpdg==", + "requires": { + "axios": "^0.27.2", + "big-integer": "^1.6.51", + "form-data": "^4.0.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", diff --git a/package.json b/package.json index 1c65d361f..678d7df46 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "file-saver": "2.0.5", "formidable": "3.5.0", "html-react-parser": "3.0.12", + "insta-fetcher": "^1.3.26", "isomorphic-fetch": "3.0.0", "jszip": "3.10.1", "lodash": "4.17.21", diff --git a/src/pages/new/from-image.tsx b/src/pages/new/from-image.tsx index ab381b445..91ad5fb1d 100644 --- a/src/pages/new/from-image.tsx +++ b/src/pages/new/from-image.tsx @@ -45,4 +45,5 @@ export default function NewWallpaperFromImagePage() { * TODO: Allow to use Camera (maybe in new route /new/from-camera) * TODO: [🌾] Unite design of all /new/* pages * TODO: [🥩] Make /new/just-from-image + * TODO: [🏍] Standardize process of getting input data for new wallpaper */ diff --git a/src/pages/new/from-instagram.tsx b/src/pages/new/from-instagram.tsx index f9bead9c3..854c28b95 100644 --- a/src/pages/new/from-instagram.tsx +++ b/src/pages/new/from-instagram.tsx @@ -1,12 +1,11 @@ -import { useState } from 'react'; +import { fetchUser } from 'insta-fetcher'; +import { useRef } from 'react'; import { StaticAppHead } from '../../components/AppHead/StaticAppHead'; import { Center } from '../../components/Center/Center'; import styles from '../../styles/static.module.css' /* <- TODO: [🤶] Get rid of page css and only use components (as ) */; -import { string_url } from '../../utils/typeAliases'; -import { isValidUrl } from '../../utils/validators/isValidUrl'; export default function NewWallpaperFromInstagramPage() { - const [url, setUrl] = useState(null); + const instagramNameInputRef = useRef(null); return ( <> @@ -16,18 +15,14 @@ export default function NewWallpaperFromInstagramPage() {

    AI Web Maker

    - Write URL to make new web from: - setUrl(event.target.value)} - /> + Write your Instagram name to make new web from: +