From 7dbd846c0df24d2ed45103d674d5ef361e6f23b3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 14 Jun 2023 06:25:28 +0300 Subject: backup: moved to `scripts` directory, cleanup lint warnings --- backup/.github/dependabot.yml | 7 ------- backup/.gitignore | 2 -- backup/index.js | 34 ------------------------------ backup/package-lock.json | 49 ------------------------------------------- backup/package.json | 24 --------------------- 5 files changed, 116 deletions(-) delete mode 100644 backup/.github/dependabot.yml delete mode 100644 backup/.gitignore delete mode 100644 backup/index.js delete mode 100644 backup/package-lock.json delete mode 100644 backup/package.json (limited to 'backup') diff --git a/backup/.github/dependabot.yml b/backup/.github/dependabot.yml deleted file mode 100644 index 4872c5af..00000000 --- a/backup/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 diff --git a/backup/.gitignore b/backup/.gitignore deleted file mode 100644 index f47a86b1..00000000 --- a/backup/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/** -dist/** \ No newline at end of file diff --git a/backup/index.js b/backup/index.js deleted file mode 100644 index fccc4439..00000000 --- a/backup/index.js +++ /dev/null @@ -1,34 +0,0 @@ -var argv = require('minimist')(process.argv.slice(2)); - -if (typeof argv.u !== "string") { - console.log("username must be specified (-u ugnich)"); - process.exit(1); -} - -var messages = []; - -function getBlogData(blogUrl, callback) { - fetch(blogUrl) - .then(function(res) { - return res.json() - }) - .then(function(msgs) { - msgs.forEach(function(message) { - messages.push(message); - }); - if (msgs.length == 20) { - blog.searchParams.set("before_mid", msgs.slice(-1).pop().mid); - setTimeout(getBlogData, 1000, blog, callback); - } else { - callback(); - } - }); -}; - -var blog = new URL("https://api.juick.com/messages"); -blog.searchParams.append("uname", argv.u); - -getBlogData(blog, function() { - console.log(JSON.stringify(messages)); -}); - diff --git a/backup/package-lock.json b/backup/package-lock.json deleted file mode 100644 index b298f6e9..00000000 --- a/backup/package-lock.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "juick-backup", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "juick-backup", - "version": "1.0.0", - "license": "MIT", - "dependencies": { - "minimist": "^1.2.8" - }, - "devDependencies": { - "@types/node": "^20.3.0" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/@types/node": { - "version": "20.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.0.tgz", - "integrity": "sha512-cumHmIAf6On83X7yP+LrsEyUOf/YlociZelmpRYaGFydoaPdxdt80MAbu6vWerQT2COCp2nPvHdsbD7tHn/YlQ==", - "dev": true - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - } - }, - "dependencies": { - "@types/node": { - "version": "20.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.0.tgz", - "integrity": "sha512-cumHmIAf6On83X7yP+LrsEyUOf/YlociZelmpRYaGFydoaPdxdt80MAbu6vWerQT2COCp2nPvHdsbD7tHn/YlQ==", - "dev": true - }, - "minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" - } - } -} diff --git a/backup/package.json b/backup/package.json deleted file mode 100644 index 61893856..00000000 --- a/backup/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "juick-backup", - "version": "1.0.0", - "description": "Juick export utility", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/juick/backup.git" - }, - "private": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.8" - }, - "devDependencies": { - "@types/node": "^20.3.0" - }, - "engines": { - "node": ">= 18" - } -} -- cgit v1.2.3