Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ Copy the example environment file and configure your settings:
cp .env.example .env
```

Edit the `.env` file to set your configuration:
Edit the `.env` file to set your configuration:
- `PORT`: The port to run the server on (default: 8000)
- `HARDCOVER_TOKEN`: Your Hardcover API token (required for development)

To generate a Hardcover API token, visit https://hardcover.app/account/api/keys/new?scope=read%3Acatalog%3Adata+read%3Alibrary%3Apublic+read%3Ausers+read%3Asocial to create a new token with the required permissions pre-selected.

### Installation

Install dependencies:
Expand Down
6 changes: 3 additions & 3 deletions internal/feed/hardcover.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ func (b *hardcoverBuilder) getUserInterests(
earliest := now.AddDate(-2, 0, 0)
log.Info().Msg("Fetching user interests")
data, err := hardcover.UserInterests(ctx, b.client, username, earliest)
if err != nil {
return interests, err
}
log.Info().
Dur("elapsed", time.Since(now)).
Int("count", len(data.UserBooks)).
Msg("Retrieved user interests")
if err != nil {
return interests, err
}
if len(data.Users) == 0 {
return interests, nil
}
Expand Down
2 changes: 1 addition & 1 deletion internal/hardcover/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (t *authTransport) RoundTrip(req *http.Request) (*http.Response, error) {
req.Header.Set("Authorization", t.key)
req.Header.Set(
"User-Agent",
fmt.Sprintf("bookfeed/%s (https://github.com/RobBrazier/bookfeed)", version),
fmt.Sprintf("bookfeed/%s (https://github.com/robbrazier/bookfeed)", version),
)
return t.wrapped.RoundTrip(req)
}
Expand Down