Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing #1

Open
clay-027 opened this issue Dec 18, 2022 · 4 comments
Open

installing #1

clay-027 opened this issue Dec 18, 2022 · 4 comments

Comments

@clay-027
Copy link

bro how to install and how to use it?

@NeelRanka
Copy link

Hi @clay-027,
I'm not the author of the tool, but you can simply use this as a dependency in your own go project and call the parser to parse your domains.

package main

import (
	"bufio"
	"github.com/Cgboal/DomainParser"
	"fmt"
	"os"
	"strings"
)

func main(){

	parser := parser.NewDomainParser()
	sc := bufio.NewScanner(os.Stdin)
	
	for sc.Scan() {
		line := sc.Text()
		// domain := parser.GetDomain(line)
		line = strings.ToLower(line)
		fqdn := parser.GetFQDN(line)
		fmt.Println(fqdn)
	}

}

I have made my own seprate go project and just use this as a dependency.
Then just build the project and you can run the tool

@L0daW
Copy link

L0daW commented Jul 15, 2023

Hi @clay-027, I'm not the author of the tool, but you can simply use this as a dependency in your own go project and call the parser to parse your domains.

package main

import (
	"bufio"
	"github.com/Cgboal/DomainParser"
	"fmt"
	"os"
	"strings"
)

func main(){

	parser := parser.NewDomainParser()
	sc := bufio.NewScanner(os.Stdin)
	
	for sc.Scan() {
		line := sc.Text()
		// domain := parser.GetDomain(line)
		line = strings.ToLower(line)
		fqdn := parser.GetFQDN(line)
		fmt.Println(fqdn)
	}

}

I have made my own seprate go project and just use this as a dependency. Then just build the project and you can run the tool

go build main.go
main.go:5:2: no required module provides package github.com/Cgboal/DomainParser: go.mod file not found in current directory or any parent directory; see 'go help modules'

@Owatron
Copy link

Owatron commented Jul 21, 2023

still couldnt install , please help

@NeelRanka
Copy link

NeelRanka commented Jul 21, 2023

after you copy the main.go contents,
you will need to make a go.mod file in the same directory
type go mod edit -module=github.com/yourName/example => this will create a go.mod file

then get the actual parser using go get github.com/Cgboal/DomainParser in the same directory => this will add the dependency to you go.mod file

Now if you try to do go builld main.go it will succeed => (this will create an executable as main)

to run the tool using this method, command:

cat [subdomainFileLocation] | go run main.go
OR
cat [subdomainFileLocation] | ./main (I assume that the build you do using go build will create an executable called "main")

another way would be to use the wrapper I wrote and directly install the executable using

go install github.com/NeelRanka/DomainParser@latest
usage : cat subdomainFileLocation | DomainParser => (assuming you have the executable dir set using GOROOT and GOPATH)

PS: Credits to the author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants