Feed cursor pagination (#49)

* Expose promoted tweets in feed output

* Add cursor-based feed pagination output
This commit is contained in:
Lucius
2026-04-10 01:20:18 +08:00
committed by GitHub
parent e3545ab069
commit 7816f8d813
12 changed files with 199 additions and 13 deletions

View File

@@ -47,6 +47,7 @@ def tweet_to_dict(tweet: Tweet) -> Dict[str, Any]:
"lang": tweet.lang,
"score": tweet.score,
"isSubscriberOnly": tweet.is_subscriber_only,
"isPromoted": tweet.is_promoted,
}
if tweet.article_title is not None:
data["articleTitle"] = tweet.article_title
@@ -124,6 +125,7 @@ def tweet_from_dict(data: Dict[str, Any]) -> Tweet:
article_title=_optional_str(data.get("articleTitle")),
article_text=_optional_str(data.get("articleText")),
is_subscriber_only=bool(data.get("isSubscriberOnly", False)),
is_promoted=bool(data.get("isPromoted", False)),
)