Compare commits

..

No commits in common. "f36660d5bdf36d7c8de4599ad735fe646025be3f" and "95e7804a4accbea78778989b192196e1968562cb" have entirely different histories.

3 changed files with 4 additions and 34 deletions

View File

@ -1,16 +0,0 @@
import json
from wiki_pages import ViewingsCsv
def update_viewings_csv(token_id, token_secret):
print("Updating CSV")
ViewingsCsv.update_viewings_csv(token_id, token_secret)
print("Done!")
if __name__ == '__main__':
with open('token.json') as json_file:
token = json.load(json_file)
update_viewings_csv(token['token_id'], token['token_secret'])

View File

@ -121,22 +121,10 @@ def get_film_list(films):
film_links = []
for film in films:
film_link = generate_imdb_film_link(film)
film_link = "[{}](https://www.imdb.com/title/tt{}/)".format(film['title'], film['imdb_id'])
film_links.append(film_link)
if len(film_links) > 0:
return "<br>".join(film_links)
else:
return ""
def generate_markdown_link(text, url):
return "[{}]({})".format(text, url)
def generate_imdb_film_link(film):
return generate_markdown_link(film['title'], "https://www.imdb.com/title/tt{}/".format(film['imdb_id']))
def generate_wikipedia_page_link(page_title):
return generate_markdown_link(page_title, "https://en.wikipedia.org/wiki/{}".format(page_title.replace(" ", "_")))

View File

@ -2,7 +2,7 @@ import base64
from collections import Counter, OrderedDict
import csv
import os
import pyvips
from wand.image import Image
import worldmap
import warnings
@ -94,10 +94,8 @@ def draw_map(films_by_country, file_name="vcinema_map.svg"):
worldmap.plot(countries, cmap=["#FF4000"], opacity=opacity, filename=file_name, verbose=False)
image = pyvips.Image.new_from_file(file_name)
image = image.thumbnail_image(1000, crop=pyvips.Interesting.ALL)
png_data = image.write_to_buffer(".png")
with Image(filename=file_name, width=1000, height=655) as i:
png_data = i.make_blob("png")
os.remove(file_name)