Merge pull request #14 from rouanth/fix-cropped-images

Fix image grids not being recognized as photos
This commit is contained in:
Nomadic 2020-10-12 09:37:45 +03:00 committed by GitHub
commit e739466988

View file

@ -174,6 +174,11 @@ func readTweetsFromHTML(htm *strings.Reader) ([]*Tweet, error) {
tweet.Photos = append(tweet.Photos, link+"?format=jpg&name=large")
}
})
s.Find(".CroppedImage-image").Each(func(i int, p *goquery.Selection) {
if link, ok := p.Attr("data-image"); ok {
tweet.Photos = append(tweet.Photos, link+"?format=jpg&name=large")
}
})
// s.Find(".PlayableMedia-player").Each(func(i int, v *goquery.Selection) {
// if style, ok := v.Attr("style"); ok {
// if strings.Contains(style, "background") {