From 91b3570414cfdb4d4751e28006bf373d626d372a Mon Sep 17 00:00:00 2001 From: wlodekm Date: Sun, 10 Nov 2024 20:07:33 +0200 Subject: ok v1.0 --- index.js | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 index.js (limited to 'index.js') diff --git a/index.js b/index.js deleted file mode 100644 index fd9ead0..0000000 --- a/index.js +++ /dev/null @@ -1,40 +0,0 @@ -import * as readline from 'node:readline/promises'; -import { stdin as input, stdout as output } from 'node:process'; - -const rl = readline.createInterface({ input, output }); - -const username = await rl.question('Username: '); -const password = await rl.question('Password: '); - -console.log("logging in as %s", username) - -const authr = await (await fetch("https://api.meower.org/auth/login", { - method: "POST", - headers: { - "content-type": "application/json" - }, - body: JSON.stringify({ - username, - password - }) -})).json(); -let token = authr.token - -console.log('got token', token) - -rl.addListener('line', async (i) => { - await fetch("https://api.meower.org/home", { - method: "POST", - headers: { - "content-type": "application/json", - token - }, - body: JSON.stringify({ - content: i - }) - }) - // console.log("sent") - rl.prompt("> ") -}) - -rl.prompt("> ") \ No newline at end of file -- cgit 1.4.1-2-gfad0