Skip to content

Commit

Permalink
hotfix: temporarily disable SSL certificate verification on dormitory…
Browse files Browse the repository at this point in the history
… Page
  • Loading branch information
hgsanguk committed Mar 27, 2024
1 parent 41708a7 commit 0bde19c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/discordbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
tree = app_commands.CommandTree(bot)
global status
CRAWLING_PERIOD = 1
BOT_VERSION = 'v1.2.2'
BOT_VERSION = 'v1.2.3'
food_notification_time = [datetime.time(hour=i, minute=0,
tzinfo=datetime.timezone(datetime.timedelta(hours=9))) for i in range(9, 13)]
notice_crawling_time = [datetime.time(hour=i, minute=30,
Expand Down
6 changes: 4 additions & 2 deletions src/noticecrawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import requests
import datetime
from bs4 import BeautifulSoup
import urllib3

urllib3.disable_warnings()
notice_db = sqlite3.connect("notice.db", isolation_level=None)
cur = notice_db.cursor()

Expand Down Expand Up @@ -41,7 +43,7 @@ def get_notice(board_name, table_name):


def get_domi_notice():
response = requests.get('https://domi.seoultech.ac.kr/do/notice/')
response = requests.get('https://domi.seoultech.ac.kr/do/notice/', verify=False)
parser = BeautifulSoup(response.text, "html.parser")
rows = parser.select('.list_3 > li')
new_notice = []
Expand All @@ -51,7 +53,7 @@ def get_domi_notice():
bidx = int(url.split('&')[2].strip('bidx='))
try:
cur.execute('INSERT INTO Dormitory VALUES(?)', (bidx,))
response = requests.get('https://domi.seoultech.ac.kr/do/notice/' + url)
response = requests.get('https://domi.seoultech.ac.kr/do/notice/' + url, verify=False)
parser = BeautifulSoup(response.text, "html.parser")
try:
author = parser.select('.date > span:nth-child(2) > font:nth-child(1)')[0].text
Expand Down

0 comments on commit 0bde19c

Please sign in to comment.