Authentication is required!

(quick dirty fix)
Close #115
This commit is contained in:
Alexander Sheiko 2023-07-02 01:41:48 +03:00
parent 5b0c8c3f9f
commit 07ad3789ef
9 changed files with 274 additions and 147 deletions

View file

@ -88,15 +88,16 @@ func (timeline *timelineV1) parseTweet(id string) *Tweet {
username := timeline.GlobalObjects.Users[tweet.UserIDStr].ScreenName
name := timeline.GlobalObjects.Users[tweet.UserIDStr].Name
tw := &Tweet{
ID: id,
Likes: tweet.FavoriteCount,
Name: name,
PermanentURL: fmt.Sprintf("https://twitter.com/%s/status/%s", username, id),
Replies: tweet.ReplyCount,
Retweets: tweet.RetweetCount,
Text: tweet.FullText,
UserID: tweet.UserIDStr,
Username: username,
ID: id,
ConversationID: tweet.ConversationIDStr,
Likes: tweet.FavoriteCount,
Name: name,
PermanentURL: fmt.Sprintf("https://twitter.com/%s/status/%s", username, id),
Replies: tweet.ReplyCount,
Retweets: tweet.RetweetCount,
Text: tweet.FullText,
UserID: tweet.UserIDStr,
Username: username,
}
tm, err := time.Parse(time.RubyDate, tweet.CreatedAt)
@ -125,6 +126,10 @@ func (timeline *timelineV1) parseTweet(id string) *Tweet {
tw.RetweetedStatusID = tweet.RetweetedStatusIDStr
}
if tweet.SelfThread.IDStr == id {
tw.IsSelfThread = true
}
if tweet.Views.Count != "" {
views, viewsErr := strconv.Atoi(tweet.Views.Count)
if viewsErr != nil {