From 49d1102a4528a2ed858a44f075a97954c1cbf2a2 Mon Sep 17 00:00:00 2001 From: Misha Date: Tue, 8 Aug 2023 01:02:02 -0500 Subject: [PATCH] Added some comments --- mastodon-get-posts.org | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mastodon-get-posts.org b/mastodon-get-posts.org index 60639aa..9da98b9 100644 --- a/mastodon-get-posts.org +++ b/mastodon-get-posts.org @@ -1,7 +1,7 @@ * Import #+begin_src python -import json -import requests +import json # to parse data +import requests # to get data import pandas as pd from mastodon import Mastodon # to get the user id from datetime import date # to get the current date @@ -10,6 +10,7 @@ from bs4 import BeautifulSoup # to more easily read the html output #+end_src * Get/refresh data - I used [[https://jrashford.com/2023/02/13/how-to-scrape-mastodon-timelines-using-python-and-pandas/][this]] setup. +- Only have to be refreshed (run) every now and then #+begin_src python # Get access token personal_access_token=subprocess.check_output(["pass", 'mastodon/access_token']).strip().decode('utf-8') @@ -51,7 +52,7 @@ df.to_csv(file_name_save, index=False) #+end_src * Use/search data -Use existing data multiple times. +- You don't have to load all data for every search. #+begin_src python df=pd.read_csv(file_name_save)