wip: 🔕 temporary commit

This commit is contained in:
Paramtamtam 2024-06-28 16:55:06 +04:00
parent 2776c41e0d
commit a759504971
No known key found for this signature in database
GPG Key ID: 366371698FAD0A2B
10 changed files with 287 additions and 9 deletions

View File

@ -317,13 +317,18 @@ func (cmd *command) Run(ctx context.Context, log *logger.Logger, cfg *config.Con
// url=https%3A%2F%2Ferror-pages.goatcounter.com%2Fcounter%2F%2Fuse-template%2Flost-in-space.json // url=https%3A%2F%2Ferror-pages.goatcounter.com%2Fcounter%2F%2Fuse-template%2Flost-in-space.json
// &query=%24.count&label=Used%20times) // &query=%24.count&label=Used%20times)
go func() { go func() {
var tpl = url.QueryEscape(cfg.TemplateName)
req, reqErr := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf( req, reqErr := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(
"https://error-pages.goatcounter.com/count?event=true&p=/use-template/%s", url.QueryEscape(cfg.TemplateName), // https://www.goatcounter.com/help/pixel
"https://error-pages.goatcounter.com/count?e=true&p=/use-template/%s&t=%s", tpl, tpl,
), http.NoBody) ), http.NoBody)
if reqErr != nil { if reqErr != nil {
return return
} }
req.Header.Set("User-Agent", "error-pages") // by default, the User-Agent is "Go-http-client/x.x"
resp, respErr := (&http.Client{Timeout: 10 * time.Second}).Do(req) //nolint:mnd // don't care about the response resp, respErr := (&http.Client{Timeout: 10 * time.Second}).Do(req) //nolint:mnd // don't care about the response
if respErr != nil { if respErr != nil {
log.Debug("Cannot send a request to increment the template usage counter", logger.Error(respErr)) log.Debug("Cannot send a request to increment the template usage counter", logger.Error(respErr))

273
templates/orient.html Normal file

File diff suppressed because one or more lines are too long