DomainParser icon indicating copy to clipboard operation
DomainParser copied to clipboard

installing

Open clay-027 opened this issue 3 years ago • 4 comments

bro how to install and how to use it?

clay-027 avatar Dec 18 '22 05:12 clay-027

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

NeelRanka avatar Jan 11 '23 06:01 NeelRanka

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'

L0daW avatar Jul 15 '23 16:07 L0daW

still couldnt install , please help

Owatron avatar Jul 21 '23 16:07 Owatron

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

NeelRanka avatar Jul 21 '23 18:07 NeelRanka