From d77b81ec36a6995af6a8039121d19802bab8352e Mon Sep 17 00:00:00 2001 From: s Date: Tue, 18 Nov 2025 06:36:53 -0500 Subject: chore: remove api documentation and refactor github leads + crawl commands to add new parameters --- internal/client/github.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'internal/client/github.go') diff --git a/internal/client/github.go b/internal/client/github.go index f8b7097..35e8b2c 100644 --- a/internal/client/github.go +++ b/internal/client/github.go @@ -58,19 +58,30 @@ func (c *Client) SearchGitHubLeads(query string, callback func(result json.RawMe return nil } -func (c *Client) SearchGitHubLeadsWithParams(query, sort, exclude string, callback func(result json.RawMessage) error) error { +func (c *Client) SearchGitHubLeadsWithParams(query, sort, exclude, format, bio string, callback func(result json.RawMessage) error) error { path := "/github/leads" params := url.Values{} - params.Set("q", query) + if query != "" { + params.Set("q", query) + } if sort != "" { params.Set("sort", sort) } if exclude != "" { params.Set("exclude", exclude) } + if format != "" { + params.Set("format", format) + } + if bio != "" { + params.Set("bio", bio) + } - fullURL := c.config.BaseURL + path + "?" + params.Encode() + fullURL := c.config.BaseURL + path + if len(params) > 0 { + fullURL += "?" + params.Encode() + } req, err := http.NewRequest(http.MethodGet, fullURL, nil) if err != nil { -- cgit v1.2.3