Skip to content

mitakeck/tagoquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

tagoquery

tagoquery : simple goquery wrapper

WIP

Usage

get github trending

const url = "https://github.com/trending"

// Repos is represents a GitHub repostry in https://github.com/trending
type Repos struct {
	Repo []struct {
		Name        string `html:"div:nth-child(1) h3 a text{}"`
		URL         string `html:"div:nth-child(1) h3 a href{}"`
		Description string `html:"div:nth-child(3) p text{}"`
		Lang        string `html:"div:nth-child(4) span:nth-child(2) text{}"`
	} `html:"div.columns div.explore-content ol li"`
}
// fetch repos
result := Repos{}
tagoquery.Unmarshal(url, &result)

// show repos
for i, r := range result.Repo {
  fmt.Printf("%s: %s\n", r.Name, r.URL)
}

About

tagoquery : simple goquery wrapper

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published