diff --git a/.envrc b/.envrc deleted file mode 100644 index 0a722d7..0000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -use nix; diff --git a/.gitignore b/.gitignore index db60114..0d4fa73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ main index.html -.direnv diff --git a/main.go b/main.go index c543252..b913ee7 100644 --- a/main.go +++ b/main.go @@ -57,7 +57,7 @@ type HatsSite struct { } func getSite(domainName string, wd selenium.WebDriver) (hatsSite HatsSite) { - log.Printf("Retrieving info for %v\n", domainName) + log.Printf("Retrieving info for %v\n", hatsSite.DomainName) hatsSite.DomainName = domainName hatsSite.FetchTime = time.Now() @@ -147,7 +147,7 @@ func main() { const ( geckoDriverPath = "deps/geckodriver" - geckoDriverPort = 8081 + geckoDriverPort = 8080 ) opts := []selenium.ServiceOption{ @@ -162,9 +162,7 @@ func main() { } defer service.Stop() - wd, err := selenium.NewRemote(selenium.Capabilities{ - "acceptInsecureCerts": true, - }, fmt.Sprintf("http://localhost:%d", geckoDriverPort)) + wd, err := selenium.NewRemote(nil, fmt.Sprintf("http://localhost:%d", geckoDriverPort)) if err != nil { panic(err) } @@ -172,12 +170,12 @@ func main() { if *serve { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - err = generateHTML(getSites(*largest, wd), w) - if err != nil { - w.Write([]byte(err.Error())) - } + // err := generateHTML(w, *largest, wd) + // if err != nil { + // w.Write([]byte(err.Error())) + // } }) - fmt.Printf("Serving on %v\n", *port) + fmt.Printf("Serving on %v\n", port) log.Fatal(http.ListenAndServe(fmt.Sprintf(":%v", *port), nil)) } else { file, err := os.Create(*filename) @@ -186,7 +184,7 @@ func main() { } err = generateHTML(getSites(*largest, wd), file) if err != nil { - log.Fatal(err) + fmt.Println(err) } } } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 7d09546..0000000 --- a/shell.nix +++ /dev/null @@ -1,12 +0,0 @@ -let - nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05"; - pkgs = import nixpkgs { config = {}; overlays = []; }; -in - -pkgs.mkShellNoCC { - packages = with pkgs; [ - go - xorg.xorgserver # xorg.xvfb once https://github.com/NixOS/nixpkgs/commit/43ebb05c575221362b44d7cc9a0f0cd1b5d3a53d hits stable - xorg.xauth - ]; -} diff --git a/template.html b/template.html index 09a07b6..6790977 100644 --- a/template.html +++ b/template.html @@ -6,63 +6,36 @@
Last updated {{(index . 0).FetchTime.Format "Jan 2, 2006" }}
- {{ $errors := false -}} - {{- range . -}} - {{- with .Error -}} - {{- $errors = true -}} - {{- end -}} - {{- end -}} - {{- if $errors -}} -