Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Handling Long Tweets with note_tweet Field #313

Merged
merged 1 commit into from
Jun 25, 2024
Merged
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
1 change: 1 addition & 0 deletions fields/tweet_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
TweetFieldSource TweetField = "source"
TweetFieldText TweetField = "text"
TweetFieldWithheld TweetField = "withheld"
TweetFieldNoteTweet TweetField = "note_tweet"
)

func (f TweetField) String() string {
Expand Down
11 changes: 11 additions & 0 deletions resources/tweet.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Tweet struct {
ReplySettings *string `json:"reply_settings,omitempty"`
Source *string `json:"source,omitempty"`
Withheld *TweetWithheld `json:"withheld,omitempty"`
NoteTweet *TweetNoteTweet `json:"note_tweet,omitempty"`
}

type TweetAttachments struct {
Expand Down Expand Up @@ -132,3 +133,13 @@ type TweetWithheld struct {
Copyright *bool `json:"copyright"`
CountryCodes []*string `json:"country_codes"`
}

type TweetNoteTweet struct {
Entities struct {
CashTags []TweetEntityTag `json:"cashtags"`
HashTags []TweetEntityTag `json:"hashtags"`
Mentions []TweetEntityTag `json:"mentions"`
URLs []URL `json:"urls"`
} `json:"entities"`
Text *string `json:"text"`
}
Loading