aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-25 23:53:10 -0300
committerLibravatar Renard 2019-09-25 23:53:10 -0300
commitbadbbe62786b054ec73b7a2663af5de0169b14b9 (patch)
treeaf0ee7dd8288ca2fc014eca04dcafbe20120ef4b
parent90e8e60ca131f4366c68b9d5759f5179092e20da (diff)
downloadweabot-badbbe62786b054ec73b7a2663af5de0169b14b9.tar.gz
weabot-badbbe62786b054ec73b7a2663af5de0169b14b9.tar.xz
weabot-badbbe62786b054ec73b7a2663af5de0169b14b9.zip
API: boardsExtra
-rw-r--r--cgi/api.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/cgi/api.py b/cgi/api.py
index 462c2c2..9321037 100644
--- a/cgi/api.py
+++ b/cgi/api.py
@@ -389,6 +389,19 @@ def api_process(self, path_split):
elif method == "blotter":
latest_news = FetchAll("SELECT `timestamp`, `message`, `timestamp_formatted` FROM `news` WHERE `type` = '2' ORDER BY `timestamp` DESC LIMIT " + str(Settings.HOME_NEWS))
values["news"] = latest_news
+ elif method == 'boardsExtra':
+ boards = FetchAll('SELECT dir, name, longname, subname, postarea_desc, postarea_extra, anonymous, subject, message, disable_name, disable_subject, allow_spoilers, allow_oekaki, num_threads, board_type, allow_images, allow_image_replies, maxsize FROM `boards` WHERE `secret`=0 ORDER BY `sort` ASC')
+ values['boards'] = boards
+ for board in values['boards']:
+ board['board_type'] = int(board['board_type'])
+ board['allow_images'] = int(board['allow_images'])
+ board['allow_image_replies'] = int(board['allow_image_replies'])
+ board['disable_name'] = int(board['disable_name'])
+ board['disable_subject'] = int(board['disable_subject'])
+ board['allow_spoilers'] = int(board['allow_spoilers'])
+ board['allow_oekaki'] = int(board['allow_oekaki'])
+ board['num_threads'] = int(board['num_threads'])
+ board['maxsize'] = int(board['maxsize'])
else:
raise APIError, "Invalid method"