Skip to content

feat: add author follower and following counts to serialized output#57

Open
edwinbernadus wants to merge 1 commit intopublic-clis:mainfrom
edwinbernadus:feature/add-follower-following-commands
Open

feat: add author follower and following counts to serialized output#57
edwinbernadus wants to merge 1 commit intopublic-clis:mainfrom
edwinbernadus:feature/add-follower-following-commands

Conversation

@edwinbernadus
Copy link
Copy Markdown

Summary

Expose author follower/following counts in parsed tweet output.

This adds followers_count and following_count to the Author model,
parses them
from Twitter user legacy fields (followers_count and friends_count), and
includes
them in serialized tweet output as author.followers and author.following.

Changes

File Change
twitter_cli/models.py Added followers_count and following_count fields to the Author dataclass.
twitter_cli/parser.py Parse followers_count and friends_count from user_legacy into the Author model.
twitter_cli/serialization.py Include author.followers and author.following in tweet_to_dict() output.

Impact

Area Before After
Author model No follower/following counts Includes followers_count and following_count
Parsed author metadata Name, screen name, avatar, verified Adds follower and following counts
Structured output No author.followers / author.following Both fields available in serialized output

Notes

  • followers_count is sourced from Twitter's user_legacy.followers_count
  • following_count is sourced from Twitter's user_legacy.friends_count
  • Default value is 0 when the source field is missing or unparsable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant