✨ Scrap more things
This commit is contained in:
parent
93171bf48c
commit
a8330a81f4
@ -6,8 +6,11 @@ type LinkMeta struct {
|
||||
Entry string `json:"entry_id" gorm:"uniqueIndex"`
|
||||
Icon string `json:"icon"`
|
||||
URL string `json:"url"`
|
||||
Image *string `json:"image"`
|
||||
Title *string `json:"title"`
|
||||
Image *string `json:"image"`
|
||||
Video *string `json:"video"`
|
||||
Audio *string `json:"audio"`
|
||||
Description *string `json:"description"`
|
||||
SiteName *string `json:"site_name"`
|
||||
Type *string `json:"type"`
|
||||
}
|
||||
|
@ -77,6 +77,12 @@ func LinkExpand(target string) (*models.LinkMeta, error) {
|
||||
meta.Image = lo.ToPtr(e.Attr("content"))
|
||||
case "og:video":
|
||||
meta.Video = lo.ToPtr(e.Attr("content"))
|
||||
case "og:audio":
|
||||
meta.Audio = lo.ToPtr(e.Attr("content"))
|
||||
case "og:site_name":
|
||||
meta.SiteName = lo.ToPtr(e.Attr("content"))
|
||||
case "og:type":
|
||||
meta.Type = lo.ToPtr(e.Attr("content"))
|
||||
}
|
||||
})
|
||||
c.OnHTML("link[rel]", func(e *colly.HTMLElement) {
|
||||
|
Loading…
Reference in New Issue
Block a user