Compare commits

..

No commits in common. "a554893b3b5244bd56a6a56f30e9863f664f5925" and "7d01a75550059598d1a7fc700c8d93f54f930c38" have entirely different histories.

5 changed files with 9 additions and 32 deletions

3
.gitignore vendored
View file

@ -2,5 +2,4 @@ scraper/**
!scraper/*.py
.venv/
__pycache__/
static/
posts/
static/

View file

@ -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)
with open(output_path + 'blog.html', "w+") as output_file:
output_file.write(blog_template.render(posts=posts))

View file

@ -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...")

View file

@ -12,16 +12,16 @@ Solidarity not charity: From Rochester, New York.
<div id="resources-box" class="fancy-border">
<h2>Quick resources</h2>
<ul id="resources-list">
<li><a href="https://docs.google.com/document/d/1UcoQ984Qwq22aR8YgyVk76VepxxFZM1QNllVeaHzWIs/edit?tab=t.0">List
of food stands</a></li>
<li><a href="https://docs.google.com/document/d/1UcoQ984Qwq22aR8YgyVk76VepxxFZM1QNllVeaHzWIs/edit?tab=t.0">List
of free food stands</a></li>
<li><a
href="https://www.google.com/maps/d/u/0/viewer?ll=43.19335689697014%2C-77.66649769973144&z=12&mid=1hGQ70VxoHncH6ardfHs6uh3HcrCp7iI">Map
of free food stands</a></li>
<li><a href="https://forms.gle/P3ZNLQe43yZS2MU99">Food Stand Repair and Info Form</a></li>
<li>Venmo: @rocfoodnotbombs</li>
<li>Email: <a href="mailto:RocFoodNotBombs@proton.me">RocFoodNotBombs@proton.me</a></li>
<li>Instagram: <a href="https://www.instagram.com/rocfnb/">@rocfnb</a></li>
<li>Donate to our Venmo: @rocfoodnotbombs</li>
<li><a href="https://rocresources.anarchyplanet.org/">Other Resources in Rochester</a></li>
</ul>
</div>
@ -49,5 +49,5 @@ Solidarity not charity: From Rochester, New York.
</p>
</div>
</div>
<!--<h2><a href="blog.html">See what we're up to :-)</a></h1>-->
<h2><a href="blog.html">See what we're up to :-)</a></h1>
{% endblock %}