diff --git a/.gitignore b/.gitignore index c01dab5..43271eb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ scraper/** !scraper/*.py .venv/ __pycache__/ -static/ -posts/ \ No newline at end of file +static/ \ No newline at end of file diff --git a/builder.py b/builder.py index ffcb0a1..d1b4909 100644 --- a/builder.py +++ b/builder.py @@ -5,7 +5,6 @@ import re from pytz import timezone from datetime import datetime import bisect -import shutil from jinja2 import Environment, PackageLoader, select_autoescape scraper_path = 'scraper/' @@ -61,16 +60,13 @@ for folder in os.listdir(scraper_path): post['caption'] = file.read() if ('timestamp' in post.keys()): - with open('posts/' + str(post['timestamp']) +'.html', 'w+') as output_file: + with open(output_path + 'posts/' + str(post['timestamp']) +'.html', 'w+') as output_file: output_file.write(post_template.render(post=post)) homepage_template = env.get_template("index.html") -with open(output_path + '/index.html', "w+") as output_file: +with open(output_path + 'index.html', "w+") as output_file: output_file.write(homepage_template.render()) -with open(output_path + '/blog.html', "w+") as output_file: - output_file.write(blog_template.render(posts=posts)) - -# copy all assets to be in the output -shutil.copytree('assets/', 'static/', dirs_exist_ok=True) \ No newline at end of file +with open(output_path + 'blog.html', "w+") as output_file: + output_file.write(blog_template.render(posts=posts)) \ No newline at end of file diff --git a/scraper/scraper.py b/scraper/scraper.py deleted file mode 100644 index ceb6d17..0000000 --- a/scraper/scraper.py +++ /dev/null @@ -1,18 +0,0 @@ -# wait between 1050 and 1150 seconds -import instaloader -from time import sleep -from random import randint -from os import listdir - -L = instaloader.Instaloader() - -L.load_session_from_file("down.loader54321") - -profile_of_interest = instaloader.Profile.from_username(L.context, "rocfnb") -files = listdir('.') -for post in profile_of_interest.get_posts(): - if not post.shortcode in files : - L.download_post(post, target=post.shortcode) - sleep(randint(1050, 1150)) - else: - print("Already downloaded " + post.shortcode +", skipping...") \ No newline at end of file diff --git a/assets/style.css b/style.css similarity index 100% rename from assets/style.css rename to style.css diff --git a/templates/index.html b/templates/index.html index f2ddb84..9400839 100644 --- a/templates/index.html +++ b/templates/index.html @@ -12,16 +12,16 @@ Solidarity not charity: From Rochester, New York.

Quick resources

@@ -49,5 +49,5 @@ Solidarity not charity: From Rochester, New York.

- +

See what we're up to :-)

{% endblock %} \ No newline at end of file