You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
765 B
Python
22 lines
765 B
Python
5 years ago
|
from mastodon import Mastodon
|
||
|
from pprint import pprint
|
||
|
|
||
|
with open('token.txt', 'r') as token:
|
||
|
mastodon = Mastodon(access_token=token.read(),
|
||
|
api_base_url="https://post.lurk.org/")
|
||
|
'''
|
||
|
mastodon direct messages, are the same as toots: *status updates*
|
||
|
With the difference that their visibility rathern than
|
||
|
being public / unlisted / private, are direct status updates
|
||
|
'''
|
||
|
|
||
|
my_credentials = mastodon.account_verify_credentials()
|
||
|
my_id = my_credentials['id']
|
||
|
my_statuses = mastodon.account_statuses(id=my_id)
|
||
|
|
||
|
for status in my_statuses:
|
||
|
if status['visibility'] == 'direct': # filter only direct msgs
|
||
|
# pprint(status)
|
||
|
pprint(status['mentions'])
|
||
|
print(status['content'], status['id'], status['created_at'], '\n')
|