retronews

a featureful fork of the luke8086/retronews hn+lobste.rs tui
Log | Files | Refs | README | LICENSE

commit 54d1f68733de0e23910b1aaea1887300b8be30b4
parent 9be91ab64e398a1f41477c012ea25bb782e49cda
Author: luke8086 <55237178+luke8086@users.noreply.github.com>
Date:   Sat, 20 Apr 2024 20:05:05 +0000

Adjust lobste.rs to recent API changes

Diffstat:
Mretronews.py | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/retronews.py b/retronews.py @@ -287,10 +287,6 @@ class HNEntry(TypedDict): url: Optional[str] -class LBUser(TypedDict): - username: str - - class LBThread(TypedDict): short_id: str short_id_url: str @@ -298,7 +294,7 @@ class LBThread(TypedDict): title: str url: str description: str - submitter_user: LBUser + submitter_user: str comment_count: int comments: Optional[list[Any]] @@ -307,7 +303,7 @@ class LBComment(TypedDict): short_id: str created_at: str url: str - commenting_user: LBUser + commenting_user: str parent_comment: Optional[str] @@ -1037,7 +1033,7 @@ def lb_parse_thread(thread: LBThread) -> Message: thread_id=f"{thread['short_id']}@lb", content_location=thread["short_id_url"], date=datetime.fromtimestamp(datetime.fromisoformat(thread["created_at"]).timestamp()), - author=thread["submitter_user"]["username"], + author=thread["submitter_user"], title=thread["title"], body=thread_body, children=None if thread.get("comments") is None else [], @@ -1050,7 +1046,7 @@ def lb_parse_thread(thread: LBThread) -> Message: thread_id=f"{thread['short_id']}@lb", content_location=comment["url"], date=datetime.fromtimestamp(datetime.fromisoformat(comment["created_at"]).timestamp()), - author=comment["commenting_user"]["username"], + author=comment["commenting_user"], title=f"Re: {thread['title']}", body=comment["comment"], children=[],