Add banner photo in profile
This commit is contained in:
parent
7e8d3badb4
commit
87fdf1c10e
2 changed files with 3 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import (
|
|||
// Profile of twitter user.
|
||||
type Profile struct {
|
||||
Avatar string
|
||||
Banner string
|
||||
Biography string
|
||||
Birthday string
|
||||
FollowersCount int
|
||||
|
|
@ -65,6 +66,7 @@ func GetProfile(username string) (Profile, error) {
|
|||
|
||||
return Profile{
|
||||
Avatar: doc.Find(".ProfileAvatar-image").First().AttrOr("src", ""),
|
||||
Banner: doc.Find(".ProfileCanopy-headerBg img").First().AttrOr("src", ""),
|
||||
Biography: doc.Find(".ProfileHeaderCard-bio.u-dir").First().Text(),
|
||||
Birthday: strings.ReplaceAll(strings.TrimSpace(doc.Find(".ProfileHeaderCard-birthdateText.u-dir").First().Text()), "Born ", ""),
|
||||
FollowersCount: parseCount(doc.Find(".ProfileNav-item--followers > a > span.ProfileNav-value").First()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue