aboutsummaryrefslogtreecommitdiff
path: root/cgi/weabot.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/weabot.py')
-rwxr-xr-xcgi/weabot.py33
1 files changed, 7 insertions, 26 deletions
diff --git a/cgi/weabot.py b/cgi/weabot.py
index 7e27ca7..eba4c72 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -192,8 +192,9 @@ class weabot(object):
elif path_split[1] == "api":
import api
caught = True
- self.headers = [("Content-Type", "application/json"), ("Access-Control-Allow-Origin", "*"), ("Access-Control-Allow-Methods",
- "PUT, GET, POST, DELETE, OPTIONS"), ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")]
+ self.headers = [("Content-Type", "application/json"), ("Access-Control-Allow-Origin", "*"),
+ ("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, OPTIONS"),
+ ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")]
OpenDb()
api.api(self, path_split)
elif path_split[1] == "threadlist":
@@ -492,7 +493,7 @@ class weabot(object):
message = message.replace("\r", "")
# check ! functions before
- extend = extend_str = dice = ball = None
+ extend = extend_str = None
if not post["parentid"] and board["dir"] not in ['bai', 'world']:
# creating thread
@@ -504,20 +505,6 @@ class weabot(object):
extend_str = res.group(0)
message = message[res.end(0):]
- if board["dir"] in ['juegos', '0', 'polka']:
- __dice = re.compile(r"^!dado(:\w+)(:\w+)?\n")
- res = __dice.match(message)
- if res:
- dice = res.groups()
- message = message[res.end(0):]
-
- if board["dir"] in ['zonavip', '0', 'polka']:
- __ball = re.compile(r"^!bola8\n")
- res = __ball.match(message)
- if res:
- ball = True
- message = message[res.end(0):]
-
# use and format message
if message.strip():
post["message"] = format_post(
@@ -527,10 +514,6 @@ class weabot(object):
if extend_str:
extend_str = extend_str.replace('!extend', 'EXTEND')
post["message"] += '<hr />' + extend_str + ' configurado.'
- if dice:
- post["message"] += '<hr />' + throw_dice(dice)
- if ball:
- post["message"] += '<hr />' + magic_ball()
if not post["parentid"] and post["email"].lower() == 'sage':
post["email"] = ""
@@ -1016,12 +999,11 @@ class weabot(object):
# 1 week = 604800
query_day = FetchAll("SELECT DATE_FORMAT(FROM_UNIXTIME(FLOOR((timestamp-10800)/86400)*86400+86400), \"%Y-%m-%d\"), COUNT(1), COUNT(IF(parentid=0, 1, NULL)) "
"FROM posts "
- "WHERE (timestamp-10800) > (UNIX_TIMESTAMP()-604800) AND (IS_DELETED = 0 OR IS_DELETED = 3) "
+ "WHERE (timestamp-10800) > (UNIX_TIMESTAMP()-604800) AND (IS_DELETED = 0) "
"GROUP BY FLOOR((timestamp-10800)/86400) "
"ORDER BY FLOOR((timestamp-10800)/86400)", 0)
- query_count = FetchOne(
- "SELECT COUNT(1), COUNT(NULLIF(file, '')), VERSION() FROM posts", 0)
+ query_count = FetchOne("SELECT COUNT(1), COUNT(NULLIF(file, '')), VERSION() FROM posts", 0)
total = int(query_count[0])
total_files = int(query_count[1])
mysql_ver = query_count[2]
@@ -1033,8 +1015,7 @@ class weabot(object):
for date, count, threads in query_day[1:]:
days.append((date, count, threads))
- query_b = FetchAll(
- "SELECT id, dir, name FROM boards WHERE boards.secret = 0", 0)
+ query_b = FetchAll("SELECT id, dir, name FROM boards WHERE boards.secret = 0", 0)
boards = []
totalp = 0