direct message read script: added
parent
a013f89424
commit
e7d021e75e
@ -0,0 +1,21 @@
|
|||||||
|
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')
|
Loading…
Reference in New Issue