it's not necessary to use access tokens
This commit is contained in:
parent
2a60da657b
commit
1bcf1c98f3
|
@ -12,18 +12,12 @@ from bs4 import BeautifulSoup # to more easily read the html output
|
||||||
- I used [[https://jrashford.com/2023/02/13/how-to-scrape-mastodon-timelines-using-python-and-pandas/][this]] setup.
|
- 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
|
- Only have to be refreshed (run) every now and then
|
||||||
#+begin_src python
|
#+begin_src python
|
||||||
# Get access token
|
# Get user id
|
||||||
personal_access_token=subprocess.check_output(["pass", 'mastodon/access_token']).strip().decode('utf-8')
|
|
||||||
|
|
||||||
# Set up access
|
|
||||||
instance = "https://social.edu.nl"
|
instance = "https://social.edu.nl"
|
||||||
mastodon = Mastodon(api_base_url=instance, access_token=personal_access_token)
|
username = "mishavelthuis"
|
||||||
|
id = json.loads(requests.get("https://social.edu.nl/api/v1/accounts/lookup?acct=mishavelthuis").text)['id']
|
||||||
|
|
||||||
# Get user's info
|
URL = f'{instance}/api/v1/accounts/{id}/statuses'
|
||||||
me = mastodon.me()
|
|
||||||
my_id = me["id"]
|
|
||||||
|
|
||||||
URL = f'{instance}/api/v1/accounts/{my_id}/statuses'
|
|
||||||
params = {
|
params = {
|
||||||
'limit': 40
|
'limit': 40
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue