Tweaked cats and layout
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
@@ -38,11 +38,13 @@ func init() {
|
||||
}
|
||||
|
||||
func GetLatestBooks() (map[string]*Book, error) {
|
||||
fmt.Println("Fetching latest book recommendations...")
|
||||
links := []Book{}
|
||||
|
||||
page := 0
|
||||
for {
|
||||
page++
|
||||
fmt.Println("Fetching page", page)
|
||||
|
||||
resp, err := c.Get(fmt.Sprintf("https://app.thestorygraph.com/to-read/averagemarcus?page=%d", page))
|
||||
if err != nil {
|
||||
@@ -100,6 +102,7 @@ func GetLatestBooks() (map[string]*Book, error) {
|
||||
"Business": nextByTag(links, "Business"),
|
||||
"Technology": nextByTag(links, "Technology"),
|
||||
"Sci-Fi": nextByTag(links, "Sci-Fi"),
|
||||
"Fantasy": nextByTag(links, "Fantasy"),
|
||||
"Comics": nextByTag(links, "Comics"),
|
||||
}, nil
|
||||
}
|
||||
@@ -192,6 +195,8 @@ func getTags(decs iter.Seq[*html.Node]) []string {
|
||||
tags["Technology"] = true
|
||||
case "science fiction":
|
||||
tags["Sci-Fi"] = true
|
||||
case "fantasy":
|
||||
tags["Fantasy"] = true
|
||||
case "comics":
|
||||
tags["Comics"] = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user