stargather

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	URL    string
	End    bool
	Proxy  string
	Stars  []string `goquery:"h3 span a[data-hovercard-type='user'],text"`
	Button []string `goquery:"div.BtnGroup a.btn.btn-outline.BtnGroup-item,[href]"`
	Cookie string
}

Data defines required options

func New

func New(repository string, cookie string, proxy string) (*Data, error)

New to define stargather datas

func (*Data) Extract

func (d *Data) Extract(username string) (*Profile, error)

Extract GitHub user informations

func (*Data) Gather

func (d *Data) Gather() (*Data, error)

Gather stargazers of GitHub repository

type Profile

type Profile struct {
	Organization string   `goquery:"ul.vcard-details li[itemprop='worksFor'] span,text"`
	Location     string   `goquery:"ul.vcard-details li[itemprop='homeLocation'] span,text"`
	Email        string   `goquery:"ul.vcard-details li[itemprop='email'] a,text"`
	Twitter      string   `goquery:"ul.vcard-details li[itemprop='twitter'] a,text"`
	Tabs         []string `goquery:"div.flex-order-1.flex-md-order-none.mt-2.mt-md-0 div a span,text"` // Followers, following, stars
	Repositories []string `goquery:"span.Counter,text"`                                                // 0 == 3 = Repositories count
}

Profile defines user informations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL