From 71edd9d035e5de8fc118f0341c790f379af83226 Mon Sep 17 00:00:00 2001 From: horus Date: Sat, 28 Mar 2026 22:06:49 +0100 Subject: stargazers html changed --- github.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'github.go') diff --git a/github.go b/github.go index 7f1b9bc..0fd1b46 100644 --- a/github.go +++ b/github.go @@ -9,12 +9,12 @@ import ( "net/http" "regexp" - log "github.com/sirupsen/logrus" "github.com/gocolly/colly" + log "github.com/sirupsen/logrus" "github.com/abadojack/whatlanggo" - "github.com/grokify/html-strip-tags-go" - "github.com/writeas/go-strip-markdown" + strip "github.com/grokify/html-strip-tags-go" + stripmd "github.com/writeas/go-strip-markdown" ) func (app *App) ScrapeGithub(platform Platform) []Entry { @@ -32,6 +32,7 @@ func (app *App) ScrapeGithub(platform Platform) []Entry { c := app.customCollector([]string{"www.github.com", "github.com"}) c.OnHTML(".Box-row", func(e *colly.HTMLElement) { + entry := Entry{} owner := Owner{} @@ -47,7 +48,7 @@ func (app *App) ScrapeGithub(platform Platform) []Entry { entry.Synopsis = e.Text }) - e.ForEach("a.Link--muted.d-inline-block.mr-3", func(i int, e *colly.HTMLElement) { + e.ForEach(".tmp-mr-3.Link.Link--muted.d-inline-block", func(i int, e *colly.HTMLElement) { if strings.Contains(e.Attr("href"), "stargazers") { stars := strings.TrimSpace(strings.Replace(e.Text, ",", "", -1)) entry.Stars, err = strconv.Atoi(stars) @@ -93,8 +94,8 @@ func (app *App) ScrapeGithub(platform Platform) []Entry { //language_info := whatlanggo.Detect(entry.Synopsis) //entry.NaturalLanguage = language_info.Lang.String() - log.Debugf("%+v\n", owner) - log.Debugf("%+v\n", entry) + log.Debugf("Owner: %+v\n", owner) + log.Debugf("Entry: %+v\n", entry) Entries = append(Entries, entry) }) -- cgit v1.2.3