Add user ID for profile
This commit is contained in:
parent
f17f720cf7
commit
7e8d3badb4
2 changed files with 2 additions and 0 deletions
|
|
@ -77,6 +77,7 @@ func GetProfile(username string) (Profile, error) {
|
|||
Name: doc.Find(".ProfileHeaderCard-nameLink").First().Text(),
|
||||
TweetsCount: parseCount(doc.Find(".ProfileNav-item--tweets.is-active > a > span.ProfileNav-value").First()),
|
||||
URL: url,
|
||||
UserID: doc.Find(".ProfileNav").First().AttrOr("data-user-id", ""),
|
||||
Username: doc.Find(".u-linkComplex-target").First().Text(),
|
||||
Website: strings.TrimSpace(doc.Find(".ProfileHeaderCard-urlText.u-dir > a").First().AttrOr("title", "")),
|
||||
}, nil
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ func TestGetProfile(t *testing.T) {
|
|||
Location: "Everywhere",
|
||||
Name: "Twitter",
|
||||
URL: "https://twitter.com/Twitter",
|
||||
UserID: "783214",
|
||||
Username: "Twitter",
|
||||
Website: "https://about.twitter.com/",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue