summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorus2026-03-28 22:06:49 +0100
committerhorus2026-03-28 22:06:49 +0100
commit71edd9d035e5de8fc118f0341c790f379af83226 (patch)
tree2a701d226769cc7a4e265dc122f9258dadf57370
parentc0abd0787eef1064772a98138089197cf1922963 (diff)
downloadghrss-master.tar.gz
stargazers html changedHEADmaster
-rw-r--r--github.go13
1 files changed, 7 insertions, 6 deletions
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)
})