Welcome to @non-biased-news
I’ll basically just post random news in life, that isn’t biased or anything.
Vote for Non Biased News Red here:
Somehow on ColorNames, there are 17 votes to make the color #ff3a3a
“Limited Edition Micah Archos Red” because it’s the color of my logo lol
Yay!
For the CodeComm API, it now works!
You can create accounts, log in, and for v1, it has a token system!!
@holidaysbot got ruined because of the news bot rules :(
note: I was going to make it
It’s kinda strange that I know the exact time but yea.
Bot News :(
ok botting rules (subject to change, but effective immediately)
bots must be clearly labelled as such, and link to the maintainer’s account in the bio or something. in the future, there might be a bot label.
bots may not perform social actions such as: following, liking, reposting
bots may not post individual posts automatically, with the exception of “daily/weekly/monthly x” accounts, which can post a maximum of one post per day at a fixed time.
bots may not reply to posts/comments unless explicitly triggered:
bots must be triggered by @ mentions, or wall comments on the bot account’s wall.
bots should use the wasteof2 api (api.wasteof.money), as the beta api is subject to change and is designed for internal usage
bots should not poll my server too hard, try using the socket.io api to only perform actions once a mention message is received.
to do this, use a server side socket.io client, and listen for updateMessageCount
events. when the count increases, request the unread message list and respond to new mention comments.
it is really cool to see all the unique ways that the api is being used, but let’s try to keep it a little bit controlled. :)
Could I have a full list of all the current users on wasteof?
I have the account @nbn for following people but I don’t have a big list.
I’m going to make a script to follow the whole list.
Does anyone know how to make it work
I’m trying to add loggin in the the CodeComm API.
It isn’t working…
help
from fastapi import FastAPI
import json
import re
from passlib.hash import pbkdf2_sha256
import ast
app = FastAPI()
accregex = r"^[a-z0-9_\\-]{0,20}$"
@app.get('/')
def main():
return {'codecomm': 'v1'}
@app.get('/accounts/join')
def join(username: str, password: str):
if re.fullmatch(accregex, username):
#hash password
password = pbkdf2_sha256.hash(password)
accjson = {username: {"name": username, "password": password, "admin": False}}
#write user data to users.json
with open('users.json') as f:
data = json.load(f)
data.update(accjson)
with open('users.json', 'w') as f:
json.dump(data, f)
return {'ok': 'made account'}
else:
return {'error': 'invalid username'}
@app.get('/accounts/login')
def login(username: str, password: str):
global userdata, userpwdhash
userdata = json.loads('users.json')
userdata = ast.literal_eval(userdata)
if username in userdata:
userdata = json.loads(userdata)
userpwdhash = userdata.get('password')
else:
return {'error': 'user not found'}
pbkdf2_sha256.verify(password, userpwdhash)
return {'ok': 'logged in'}
I’m trying to add loggin in the the CodeComm API.
It isn’t working…
help
from fastapi import FastAPI
import json
import re
from passlib.hash import pbkdf2_sha256
import ast
app = FastAPI()
accregex = r"^[a-z0-9_\\-]{0,20}$"
@app.get('/')
def main():
return {'codecomm': 'v1'}
@app.get('/accounts/join')
def join(username: str, password: str):
if re.fullmatch(accregex, username):
#hash password
password = pbkdf2_sha256.hash(password)
accjson = {username: {"name": username, "password": password, "admin": False}}
#write user data to users.json
with open('users.json') as f:
data = json.load(f)
data.update(accjson)
with open('users.json', 'w') as f:
json.dump(data, f)
return {'ok': 'made account'}
else:
return {'error': 'invalid username'}
@app.get('/accounts/login')
def login(username: str, password: str):
global userdata, userpwdhash
userdata = json.loads('users.json')
userdata = ast.literal_eval(userdata)
if username in userdata:
userdata = json.loads(userdata)
userpwdhash = userdata.get('password')
else:
return {'error': 'user not found'}
pbkdf2_sha256.verify(password, userpwdhash)
return {'ok': 'logged in'}