poppyrock2 — 5/25/2022, 5:41:30 PM

code for the current version of wasteof.replit. please feel free to steal (with credit)

// logo
console.log("                          __                   ___                         __  __  __   ")
console.log(" .--.--.--..---.-..-----.|  |_ .-----..-----..'  _|   .----..-----..-----.|  ||__||  |_ ")
console.log(" |  |  |  ||  _  ||__ --||   _||  -__||  _  ||   _|__ |   _||  -__||  _  ||  ||  ||   _|")
console.log(" |________||___._||_____||____||_____||_____||__| |__||__|  |_____||   __||__||__||____|")
console.log("                                                                   |__|                 ")
console.log("frontends? what are those?")
console.log("___________________________________")
console.log("")
console.log("Type anything to begin.")
console.log("")
var ans = prompt("")
console.clear()
console.log("Let's login first.")
console.log("")
var ans = prompt("Type your username. ")
const user = ans
var ans = prompt("Type your password. ")
const pass = ans
console.clear()
console.log("Okay, now that you have logged in, you need to select an action.")
console.log("(if you see no errors, it worked!)")
console.log("")
console.log("1| post")
console.log("")
var ans = prompt("Type 1-10 ")
// login
const WasteOfSession = require("wasteof-client")
let wasteof = new WasteOfSession(user, pass)
if (ans == 1){
  console.clear()
  var posttext = prompt("Post contents? (can be html or plain text) ")
  wasteof.login()
  .then(async function() {
  await wasteof.post(posttext, null)
  })
}
console.clear()
console.log("Done, check for errors. If there are any, you might have entered the wrong login credidentials. Rerun this repl to do another action.")

♥ 5 ↩ 0 💬 17 comments

comments

lily:

don’t define ans twice

5/25/2022, 10:04:03 PM
poppyrock2:

idc ans is a var

5/25/2022, 10:34:09 PM
sivyx:

you realize you could put all of those console.log functions into one with linebreaks?

5/25/2022, 7:02:08 PM
sivyx:

you could also define the variables themselves with the prompt function, removing a step.

5/25/2022, 7:03:33 PM
oren:

Yeah

5/25/2022, 7:04:18 PM
poppyrock2:

ik

5/25/2022, 7:04:44 PM
poppyrock2:

i tried \n but it returned an error

5/25/2022, 7:04:37 PM
oren:

You can use try and catch for errors

5/25/2022, 6:32:11 PM
poppyrock2:

the errors come from the wasteof api, not javascript errors

5/25/2022, 6:33:52 PM
oren:

Wasteof-client will throw errors if the api errors

5/25/2022, 6:35:36 PM
poppyrock2:

one question about wasteof.client, is it possible to change profile pictures using it?

6/2/2022, 1:02:34 PM
oren:

No, back when i made it I wasn't good at node so i avoided doing that

6/2/2022, 1:05:27 PM
poppyrock2:

do you know any other client that can do that?

or any way i can code it in node?

6/2/2022, 1:06:30 PM
oren:

I can maybe add it in, but you might want to code it yourself

Try this: https://maximorlov.com/send-a-file-with-axios-in-nodejs/

If you could make a PR to wasteof-client with that added in it would be greatly appreciated, but I’m gonna try and add it myself rn

6/2/2022, 1:39:22 PM
poppyrock2:

ok

6/2/2022, 3:46:24 PM
poppyrock2:

but i know nothing about how wasteofclient works so we will see if you can add it in and if you can’t then i will try to make it

6/2/2022, 3:47:26 PM
oren:

I tried to add it in but found some more pressing bugs in the code so you probably shouldn’t use it for a while, while I fix it

6/2/2022, 3:59:30 PM