diff --git a/dashboard/dashboard_handler.py b/dashboard/dashboard_handler.py index d180a00..7d6a4b1 100644 --- a/dashboard/dashboard_handler.py +++ b/dashboard/dashboard_handler.py @@ -30,12 +30,7 @@ def get_news_feed(): print("Waiting for Facebook lock") try: with open(FACEBOOK_FILE) as f: - data = json.load(f) - if 'data' in data and len(data['data']) > 15: - del data['data'][14:] - else: - data = {'data': []} - return data + return json.load(f) except FileNotFoundError: print("Could not find " + FACEBOOK_FILE) return {'data': []} diff --git a/facebook/facebook_handler.py b/facebook/facebook_handler.py index f492d82..da34cf8 100644 --- a/facebook/facebook_handler.py +++ b/facebook/facebook_handler.py @@ -9,9 +9,9 @@ def scrape_data(): for post in facebook_scraper.get_posts('amicale.deseleves', pages=3): print(post) cleaned_post = { - "post_id": post["post_id"], - "post_text": post["post_text"], - "post_url": post["post_url"], + "id": post["post_id"], + "message": post["post_text"], + "url": post["post_url"], "image": post["image"], "video": post["video"], "link": post["link"],