Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
benf2004 authored May 3, 2023
2 parents 6ffa540 + 49a1e19 commit 2505dbf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/**
jparty/__pycache__/**
latest.log
dist/**
dist_arm/**
.idea/**
44 changes: 0 additions & 44 deletions TODO.org

This file was deleted.

4 changes: 2 additions & 2 deletions compile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

case $(arch) in
"arm64")
pyinstaller -y JParty_arm.spec --distpath ./dist_arm
pyinstaller -y JParty.spec --distpath ./dist_arm
cd dist_arm
zip -r JParty_macos_arm.zip JParty.app/
cd ..
;;
"i386")
pyinstaller -y JParty_x86.spec --distpath ./dist_x86
pyinstaller -y JParty.spec --distpath ./dist_x86
cd dist_x86
zip -r JParty_macos_x86.zip JParty.app/
cd ..
Expand Down
11 changes: 3 additions & 8 deletions jparty/retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,12 @@ def get_JArchive_Game(game_id, soup=None, is_wayback=False, wayback_url=None):
int(index_key[-3]) - 1,
int(index_key[-1]) - 1,
) # get index from id string
js = clue.find("div")["onmouseover"]
dd = clue.find(class_="clue_value_daily_double") is not None
value = MONIES[i][index[1]]
answer = re.findall(r'correct_response">(.*?)</em', js.replace("\\", ""))[0]
answer = re.findall(r'correct_response">(.*?)</em', str(clue))[0]
questions.append(
Question(index, text, answer, categories[index[0]], value, dd)
)

boards.append(Board(categories, questions, dj=(i == 1)))

# Final Jeopardy
Expand All @@ -111,16 +109,13 @@ def get_JArchive_Game(game_id, soup=None, is_wayback=False, wayback_url=None):
return None

text = text_obj.text
index_key = text_obj["id"]
js = list(clue.parents)[1].find("div")["onmouseover"]
answer = re.findall(r'correct_response">(.*?)</em', js.replace("\\", ""))[0]
answer = re.findall(r'correct_response">(.*)</em', str(clue))[0]
question = Question((0, 0), text, answer, category)

boards.append(FinalBoard(category, question))

return GameData(boards, date, comments)


def get_wayback_jarchive_game(game_id):
# kudos to Abhi Kumbar: https://medium.com/analytics-vidhya/the-wayback-machine-scraper-63238f6abb66
# this query's the wayback cdx api for possible instances of the saved jarchive page with the specified game id & returns the latest one
Expand All @@ -144,7 +139,7 @@ def get_wayback_jarchive_game(game_id):
url_list.append(final_url)
latest_url = url_list[-1]
return get_JArchive_Game(game_id, None, True, latest_url)

def get_game_sum(soup):
date = re.search(
r"- \w+, (.*?)$", soup.select("#game_title > h1")[0].contents[0]
Expand Down
2 changes: 1 addition & 1 deletion jparty/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "2.0.1"
version = "2.0.2"
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PyQt6
requests
simpleaudio
tornado
BeautifulSoup4
pyinstaller
qrcode
PyQt6==6.4.0
requests==2.28.1
simpleaudio==1.0.4
tornado==6.2
BeautifulSoup4==4.11.1
pyinstaller==5.6.2
qrcode==7.3.1

0 comments on commit 2505dbf

Please sign in to comment.