From e8cd6ab8c5c1392ab365f66f66c6a19d556e12bc Mon Sep 17 00:00:00 2001 From: milarin Date: Fri, 3 Mar 2023 15:10:00 +0100 Subject: [PATCH] expose Get methods --- novelupdates.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/novelupdates.go b/novelupdates.go index cc442eb..9da214b 100644 --- a/novelupdates.go +++ b/novelupdates.go @@ -11,7 +11,7 @@ import ( "github.com/PuerkitoBio/goquery" ) -func (api *Api) getWithCookie(ctx context.Context, url string) (*goquery.Document, error) { +func (api *Api) GetWithCookie(ctx context.Context, url string) (*goquery.Document, error) { if api.Cookie == "" { return nil, errors.New("no API cookie set") } @@ -36,7 +36,7 @@ func (api *Api) getWithCookie(ctx context.Context, url string) (*goquery.Documen return goquery.NewDocumentFromReader(r) } -func (api *Api) get(ctx context.Context, url string) (*goquery.Document, error) { +func (api *Api) Get(ctx context.Context, url string) (*goquery.Document, error) { curl := exec.CommandContext(ctx, "curl", "-s", url, "-H", fmt.Sprintf("User-Agent: %s", api.UserAgent),