Merge pull request #2 from tolantop/pr/1
support: pinned message detection
This commit is contained in:
commit
76c0808b97
1 changed files with 4 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ type Tweet struct {
|
||||||
Hashtags []string
|
Hashtags []string
|
||||||
HTML string
|
HTML string
|
||||||
ID string
|
ID string
|
||||||
|
IsPin bool
|
||||||
IsRetweet bool
|
IsRetweet bool
|
||||||
Likes int
|
Likes int
|
||||||
PermanentURL string
|
PermanentURL string
|
||||||
|
|
@ -112,6 +113,9 @@ func FetchTweets(user string, last string) ([]*Tweet, error) {
|
||||||
s.Find(".js-retweet-text, .QuoteTweet").Each(func(i int, c *goquery.Selection) {
|
s.Find(".js-retweet-text, .QuoteTweet").Each(func(i int, c *goquery.Selection) {
|
||||||
tweet.IsRetweet = true
|
tweet.IsRetweet = true
|
||||||
})
|
})
|
||||||
|
s.Find("span.js-pinned-text").Each(func(i int, c *goquery.Selection) {
|
||||||
|
tweet.IsPin = true
|
||||||
|
})
|
||||||
s.Find(".ProfileTweet-actionCount").Each(func(i int, c *goquery.Selection) {
|
s.Find(".ProfileTweet-actionCount").Each(func(i int, c *goquery.Selection) {
|
||||||
txt := strings.TrimSpace(c.Text())
|
txt := strings.TrimSpace(c.Text())
|
||||||
if strings.HasSuffix(txt, "likes") {
|
if strings.HasSuffix(txt, "likes") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue