Compare commits

..

No commits in common. "54c4c8aa157c3107fae6929876d76f3791c58cbc" and "63c37aa3b72fb9a3ded34f0ad4aedd2d811706e8" have entirely different histories.

2 changed files with 5 additions and 6 deletions

View File

@ -1,3 +1,6 @@
from bookstack import Bookstack
from vcinema_utils import VCinemaUtils
import base64 import base64
from collections import Counter, OrderedDict from collections import Counter, OrderedDict
import csv import csv
@ -5,10 +8,6 @@ import os
from wand.image import Image from wand.image import Image
import worldmap import worldmap
import warnings import warnings
from bookstack import Bookstack
from vcinema_utils import VCinemaUtils
warnings.filterwarnings("ignore") warnings.filterwarnings("ignore")
# Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-country # Page ID of https://wiki.jacknet.io/books/vcinema/page/films-by-country

View File

@ -10,7 +10,7 @@ PAGE_ID = 11
def update_viewings_csv(token_id, token_secret, check_existing=True): def update_viewings_csv(token_id, token_secret, check_existing=True):
print("Retrieving viewings page") print("Retrieving viewings page")
html_page = Bookstack.get_page_html(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, PAGE_ID) html_page = Bookstack.get_page_html(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, CSV_PAGE_ID)
soup = BeautifulSoup(html_page, 'html.parser') soup = BeautifulSoup(html_page, 'html.parser')
csv_data = soup.find("code").text.strip().encode('utf-8') csv_data = soup.find("code").text.strip().encode('utf-8')
@ -25,7 +25,7 @@ def update_viewings_csv(token_id, token_secret, check_existing=True):
if not check_existing or page_hash != existing_attachment_hash: if not check_existing or page_hash != existing_attachment_hash:
print("Updating file") print("Updating file")
# bookstack update file via api doesn't work # bookstack update file via api doesn't work
Bookstack.post_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, "vcinema.csv", csv_data, PAGE_ID) Bookstack.post_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, "vcinema.csv", csv_data, CSV_PAGE_ID)
Bookstack.delete_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, existing_attachment_id) Bookstack.delete_attachment(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, existing_attachment_id)
print("File updated") print("File updated")
else: else: