Share your repls and programming experiences

← Back to all posts
trash chatroom
h
maazzubair99 (112)

so I saw @taylorliang 's FreeDB and thought it was really cool. I started messing around with it, and found out that i could send a message through it. I made a copy of it, used it as a server for this trash chatroom that took me way longer to make that I'd care to admit

v1.1:
fixed inputs getting cut off when new message is recived
v1.0:
inital release

Commentshotnewtop
TaylorLiang (657)

@maazzubair99 you need to add it as a env variable

TaylorLiang (657)

@maazzubair99 ok so in your env file, you have to do:

PASS=password
KEY=key

you cannot have spaces

maazzubair99 (112)

@maazzubair99 there are no spaces in the first place

TaylorLiang (657)

Im not going to lie, this is really easy to hack just like my old db.
Might make a spam/bot

maazzubair99 (112)

@TaylorLiang ik its more of a proof of concept for me. plus if you spam the same message the chat won't update

TaylorLiang (657)

@maazzubair99 yea, but the database is in your repl, for everybody to see. They can remove the man in the middle, and just send requests themself. This is also the problem with my database, as somebody (not you) keeps spamming it

maazzubair99 (112)

@TaylorLiang i was considering putting it in a .env but then i realized i have no idea how to use a .env

TaylorLiang (657)

@maazzubair99 i think you have to use a package/mod called dotenv.

maazzubair99 (112)

@TaylorLiang i figured out how to do it with os.environ and os.getenv

Haaruun (93)

instead of using FreeDB witch has the problems taylor said, you can use josonstore or quick plug FreeDB 2.0 @maazzubair99

maazzubair99 (112)

@Haaruun ok ill take a look at this

AdCharity (945)

@Haaruun jsonstore is def not secure

Haaruun (93)

Jsonstore is secure enough if you hide the token. Its near impossible to guess it. @AdCharity

AdCharity (945)

@Haaruun for small projects jsonstore is the way to go. However, if you plan for expanding the project, that might not be a great idea.

nithilan4 (118)

lmao maaz why didn't you test before you posted this

maazzubair99 (112)

@nithilan4 i did then i broke it trying to fix inputs

eekboi (62)

for some reason termcolor wont manually download.

maazzubair99 (112)

@eekboi yeah termcolor is being weird

NKStrand (0)

Bro make an application!

CodeABC123 (93)
No module named ‘termcolor’.

What?! I’m sure there is a module called termcolor. This is the weirdest thing I have seen on Repl.it.

AdCharity (945)

@CodeABC123 you'll have to manually install packages that slip through the cracks.

maazzubair99 (112)

@AdCharity i tried manual instalation but it didnt work

Foster_Bryant (86)

Imports shoulds should have their own lines. for example:
import requests
import threading
from getkey = keys, getkey

maazzubair99 (112)

@Foster_Bryant i don't see the point of putting imports on seperate lines. importing from the same line still provides the same functionalily

Foster_Bryant (86)

@maazzubair99 How do I send data to the database? asking this because I have an idea for a program i am making

maazzubair99 (112)

@Foster_Bryant

import requests
requests.post('https://repl-name.your-username-here.repl.co',data={
    'key':'key used to store your data',
    'data':'data you want to store'
})
maazzubair99 (112)

For those of you posting errors in the comments: I already know there are errors. I'm currently working on a fix. So please, just stop posting errors

maazzubair99 (112)

PSA: The only admin is me. Don't listen to anyone who claims to be an admin