Skip to content

Commit

Permalink
🐞 fix: first path segment in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
shurco committed Feb 16, 2024
1 parent 1d396eb commit 9369451
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 169 deletions.
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/",
"args": ["-s","-r", "https://www.hellokuya.co"]
},
"args": ["-s", "-r", "https://www.hellokuya.co"]
}
]
}
}
34 changes: 16 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/shurco/goclone

go 1.20
go 1.22

require (
github.com/PuerkitoBio/goquery v1.8.1
Expand All @@ -10,30 +10,28 @@ require (

require (
github.com/VividCortex/gohistogram v1.0.0 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chromedp/cdproto v0.0.0-20220428002153-285dfb42699c // indirect
github.com/chromedp/chromedp v0.8.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chromedp/cdproto v0.0.0-20240214232516-ad4608604e9e // indirect
github.com/chromedp/chromedp v0.9.5 // indirect
github.com/chromedp/sysutil v1.0.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.1.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gobwas/ws v1.3.2 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.34.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/temoto/robotstxt v1.1.2 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
google.golang.org/protobuf v1.28.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
)
70 changes: 47 additions & 23 deletions go.sum

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions pkg/arrutil/arrutil.go

This file was deleted.

39 changes: 39 additions & 0 deletions pkg/crawler/base.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package crawler

import "net/url"

type Flags struct {
Open bool
Serve bool
ServePort int
UserAgent string
ProxyString string
Cookies bool
Robots bool
BrowserEndpoint string
}

var (
files filesBase

projectURL *url.URL
projectPath string
domain string
)

type filesBase struct {
pages []string
css []string
js []string
img []string
font []string
}

func contains(slice []string, sub string) bool {
for _, s := range slice {
if s == sub {
return true
}
}
return false
}
Loading

0 comments on commit 9369451

Please sign in to comment.