Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions twitter_cli/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Author:
screen_name: str
profile_image_url: str = ""
verified: bool = False
followers_count: int = 0
following_count: int = 0


@dataclass
Expand Down
2 changes: 2 additions & 0 deletions twitter_cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def _extract_author(user_data, user_legacy):
or user_legacy.get("profile_image_url_https", "")
),
verified=bool(user_data.get("is_blue_verified") or user_legacy.get("verified", False)),
followers_count=_parse_int(user_legacy.get("followers_count"), 0),
following_count=_parse_int(user_legacy.get("friends_count"), 0),
)


Expand Down
2 changes: 2 additions & 0 deletions twitter_cli/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def tweet_to_dict(tweet: Tweet) -> Dict[str, Any]:
"screenName": tweet.author.screen_name,
"profileImageUrl": tweet.author.profile_image_url,
"verified": tweet.author.verified,
"followers": tweet.author.followers_count,
"following": tweet.author.following_count,
},
"metrics": {
"likes": tweet.metrics.likes,
Expand Down