diyalgo/diyalgo/expansions/timeline.py

20 lines
482 B
Python

from typing import List, Literal
import pdb
from mastodon import Mastodon
from diyalgo.models import Status
TIMELINES = Literal['home', 'local', 'public', 'tag', 'hashtag', 'list', 'id']
def fetch_timeline(
client:Mastodon,
timeline:TIMELINES="public",
**kwargs
) -> List[Status]:
tl = client.timeline(timeline=timeline, **kwargs)
tl = client.fetch_remaining(tl)
pdb.set_trace()
tl = [Status(**status) for status in tl]
return tl