Filtering out empty posts

This commit is contained in:
Jarian Cottingham 2025-10-14 17:41:22 -05:00
parent 1e97de5b09
commit eb355fa644

View File

@ -33,7 +33,11 @@ def get_initial_posts():
try: try:
# Use archive parser to fetch posts # Use archive parser to fetch posts
posts = archive_parser.get_posts(count=10, start_index=0) posts = archive_parser.get_posts(count=10, start_index=0)
return jsonify(posts) filters_posts = []
for p in posts:
if p["url"] != "http://archive2.home.ms/#":
filters_posts += [p]
return jsonify(filters_posts)
except Exception as e: except Exception as e:
print(f"Error: {e}") print(f"Error: {e}")
return jsonify({"error": "Failed to fetch posts"}), 500 return jsonify({"error": "Failed to fetch posts"}), 500