Skip to content

Commit

Permalink
Handle more byline scraping
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Noble <[email protected]>
  • Loading branch information
AverageMarcus committed Jan 5, 2025
1 parent 794b29f commit cceeb4f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/scraper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ func FetchURLDetails(entry *types.Entry) (*types.Entry, error) {
entry.Byline = e.Attr("content")
case "author":
entry.Byline = e.Attr("content")
case "octolytics-dimension-user_login":
entry.Byline = e.Attr("content")
}
})

c.OnHTML("span[itemprop='author']", func(e *colly.HTMLElement) {
if entry.Byline == "" {
linkChild := e.DOM.Find("link[itemprop='name']")
if linkChild != nil {
entry.Byline, _ = linkChild.Attr("content")
}
}
})

Expand Down

0 comments on commit cceeb4f

Please sign in to comment.