Skip to content
Permalink
Browse files

added two default params and gitignore file

  • Loading branch information...
marcobeierer committed Jul 2, 2019
1 parent d87d7de commit a3180ced8f722dd75f7ce18fdcc5784a740d0a6f
Showing with 7 additions and 1 deletion.
  1. +3 −0 .gitignore
  2. +4 −1 main.go
@@ -0,0 +1,3 @@
*.xml
*.txt
sitemapgenerator
@@ -8,6 +8,7 @@ import (
"log"
"net/http"
"os"
"strings"
"time"
)

@@ -60,13 +61,15 @@ func readToken(tokenPath string) (string, bool) {
func doRequest(url, token string) (string, string, bool) {
urlBase64 := base64.URLEncoding.EncodeToString([]byte(url))

req, err := http.NewRequest("GET", "https://api.marcobeierer.com/sitemap/v2/"+urlBase64, nil)
// TODO make max_etchers and reference count as param
req, err := http.NewRequest("GET", "https://api.marcobeierer.com/sitemap/v2/"+urlBase64+"?max_fetchers=3&reference_count_threshold=5", nil)
if err != nil {
log.Println(err)
return "", "", false
}

if token != "" {
token = strings.TrimSuffix(token, "\n")
req.Header.Set("Authorization", "Bearer "+token)
}

0 comments on commit a3180ce

Please sign in to comment.
You can’t perform that action at this time.