move url to utils

This commit is contained in:
Sarah 2022-02-20 21:53:36 +00:00
parent ab098dda0d
commit 5456a138c0
2 changed files with 4 additions and 6 deletions

View File

@ -6,9 +6,6 @@ from vcinema_utils import VCinemaUtils
from wiki_utils import WikiUtils from wiki_utils import WikiUtils
JACKNET_WIKI_URL = "https://wiki.jacknet.io"
def build_table(films_by_year): def build_table(films_by_year):
films_by_year_descending = OrderedDict(sorted(films_by_year.items(), key=lambda t: t[0], reverse=True)) films_by_year_descending = OrderedDict(sorted(films_by_year.items(), key=lambda t: t[0], reverse=True))

View File

@ -5,13 +5,14 @@ from imdb_utils import IMDbUtils
from wiki_utils import WikiUtils from wiki_utils import WikiUtils
JACKNET_WIKI_URL = "https://wiki.jacknet.io"
def get_vcinema_viewings(token_id, token_secret): def get_vcinema_viewings(token_id, token_secret):
# Page ID of /Vcinema/CSV # Page ID of /Vcinema/CSV
page_id = 11 page_id = 11
wiki_base_url = "https://wiki.jacknet.io" html_page = WikiUtils.get_page_export_html(page_id, JACKNET_WIKI_URL, token_id, token_secret)
html_page = WikiUtils.get_page_export_html(page_id, wiki_base_url, token_id, token_secret)
soup = BeautifulSoup(html_page, 'html.parser') soup = BeautifulSoup(html_page, 'html.parser')
elements = soup.find("code").text.strip().split("\n") elements = soup.find("code").text.strip().split("\n")