Skip to content

Commit 0ed55db

Browse files
author
Wade
committed
add ParseUsers
1 parent e853d72 commit 0ed55db

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

timeline_v2.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,26 @@ func (timeline *retweetersTimelineV2) parseUsers() ([]*Profile, string) {
308308
return users, cursor
309309
}
310310

311+
312+
func (timeline *timelineV2) ParseUsers() ([]*Profile, string) {
313+
var cursor string
314+
var users []*Profile
315+
for _, instruction := range timeline.Data.User.Result.Timeline.Timeline.Instructions {
316+
for _, entry := range instruction.Entries {
317+
if entry.Content.CursorType == "Bottom" {
318+
cursor = entry.Content.Value
319+
continue
320+
}
321+
if entry.Content.ItemContent.UserResults.Result.Typename == "User" {
322+
user := entry.Content.ItemContent.UserResults.Result.parse()
323+
users = append(users, &user)
324+
}
325+
}
326+
}
327+
return users, cursor
328+
}
329+
330+
311331
func (timeline *timelineV2) parseUsers() ([]*Profile, string) {
312332
var cursor string
313333
var users []*Profile

0 commit comments

Comments
 (0)