xvc
This commit is contained in:
parent
f23b5c63b5
commit
3364a30959
8 changed files with 27 additions and 14 deletions
|
@ -1,6 +1,6 @@
|
|||
FROM ubuntu:20.04
|
||||
|
||||
RUN apt update && apt install -y python3.8 python3-pip supervisor
|
||||
RUN apt update && apt install -y python3.8 python3-pip supervisor libenchant1c2a
|
||||
|
||||
COPY supervisord.conf /etc/supervisord.conf
|
||||
|
||||
|
|
3
env
3
env
|
@ -31,5 +31,4 @@ export MAIL_USERNAME="blahblahblah@gmail.com"
|
|||
export MAIL_PASSWORD="3435tdfsdudebussylmaoxxt43"
|
||||
export DESCRIPTION="rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!"
|
||||
export CF_KEY="3435tdfsdudebussylmaoxxt43"
|
||||
export CF_ZONE="3435tdfsdudebussylmaoxxt43"
|
||||
export WORDLE="bound candy young"
|
||||
export CF_ZONE="3435tdfsdudebussylmaoxxt43"
|
|
@ -360,6 +360,16 @@ function handle_wordle_action(cid, guess) {
|
|||
location.hash = `comment-${cid}`;
|
||||
location.reload();
|
||||
}
|
||||
else {
|
||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||
try
|
||||
{
|
||||
data = JSON.parse(xhr.response)
|
||||
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show();
|
||||
}
|
||||
catch {}
|
||||
}
|
||||
}
|
||||
xhr.send(form);
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -17,12 +17,14 @@ import requests
|
|||
from shutil import copyfile
|
||||
from json import loads
|
||||
from collections import Counter
|
||||
from enchant import Dict
|
||||
|
||||
d = Dict("en_US")
|
||||
|
||||
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
||||
|
||||
if PUSHER_ID: beams_client = PushNotifications(instance_id=PUSHER_ID, secret_key=PUSHER_KEY)
|
||||
|
||||
WORD_LIST = tuple(set(environ.get("WORDLE").split(" ")))
|
||||
WORDLE_COLOR_MAPPINGS = {-1: "🟥", 0: "🟨", 1: "🟩"}
|
||||
|
||||
@app.get("/comment/<cid>")
|
||||
|
@ -658,7 +660,7 @@ def api_comment(v):
|
|||
g.db.add(parent_post)
|
||||
|
||||
if "!wordle" in body:
|
||||
answer = random.choice(WORD_LIST)
|
||||
answer = random.choice(WORDLE_LIST)
|
||||
c.wordle_result = f'_active_{answer}'
|
||||
|
||||
g.db.commit()
|
||||
|
@ -1085,7 +1087,10 @@ def handle_wordle_action(cid, v):
|
|||
try: guess = request.values.get("guess").strip().lower()
|
||||
except: abort(400)
|
||||
|
||||
if (len(guess) == 5 and status == "active"):
|
||||
if len(guess) != 5 or not d.check(guess) and guess not in WORDLE_LIST:
|
||||
return {"error": "Not a valid guess!"}, 400
|
||||
|
||||
if status == "active":
|
||||
guesses += "".join(cg + WORDLE_COLOR_MAPPINGS[diff] for cg, diff in zip(guess, diff_words(answer, guess)))
|
||||
|
||||
if (guess == answer): status = "won"
|
||||
|
@ -1097,4 +1102,4 @@ def handle_wordle_action(cid, v):
|
|||
g.db.add(comment)
|
||||
g.db.commit()
|
||||
|
||||
return { "message" : "." }
|
||||
return {"message" : "."}
|
|
@ -1015,7 +1015,7 @@
|
|||
|
||||
{% if v %}
|
||||
<script src="/static/assets/js/marked.js?a=242"></script>
|
||||
<script src="/static/assets/js/comments_v.js?a=253"></script>
|
||||
<script src="/static/assets/js/comments_v.js?a=254"></script>
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/assets/js/clipboard.js?a=250"></script>
|
||||
|
|
|
@ -19,6 +19,7 @@ requests
|
|||
SQLAlchemy
|
||||
psycopg2-binary
|
||||
pusher_push_notifications
|
||||
pyenchant
|
||||
youtube-dl
|
||||
yattag
|
||||
webptools
|
|
@ -1,16 +1,12 @@
|
|||
cd /Drama
|
||||
sudo apt update
|
||||
sudo apt -y upgrade
|
||||
sudo apt -y install postgresql postgresql-contrib
|
||||
sudo apt -y install redis-server
|
||||
sudo apt -y install postgresql postgresql-contrib redis-server libenchant1c2a python3-pip gunicorn ffmpeg
|
||||
cp pg_hba.conf /etc/postgresql/12/main/pg_hba.conf
|
||||
sudo service postgresql restart
|
||||
sudo psql -U postgres -f schema.sql postgres
|
||||
sudo psql -U postgres -f seed-db.sql postgres
|
||||
sudo apt -y install python3-pip
|
||||
sudo pip3 install -r requirements.txt
|
||||
sudo apt -y install gunicorn
|
||||
sudo apt -y install ffmpeg
|
||||
mkdir /songs
|
||||
mkdir /images
|
||||
. imei.sh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue