tianalyser

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(cr *gocrawler.Client, config *Config, elapsed time.Duration)

Generates a report in JSON format from the crawler client and config. The report contains the initial crawler info, the network info for each host visited, and the country representation table for each TI page visited.

func TILinkExtractor

func TILinkExtractor(c *gocrawler.Client, currLink string, resp []byte) []string

Returns a list of all outgoing links with the same host as the current link and the path contains "dota2/The_International/". It also checks agains the VisitedNetInfo map to ensure that the link has not been visited before as we are not collecting the outgoing links of all pages.

Types

type Config

type Config struct {
	gocrawler.Config
	ReportPath string
}

func SetupConfig

func SetupConfig() *Config

Read config from flags to setup the crawler

func (*Config) PrintConfig

func (c *Config) PrintConfig()

Sanity check

type CountryTableRow

type CountryTableRow struct {
	Country        string   `json:"country"`
	Representation string   `json:"representation"`
	Players        []string `json:"players"`
}

type ReportFormat

type ReportFormat struct {
	Seed      string  `json:"seed"`
	MaxRPS    float64 `json:"max_rps"`
	CrawlTime string  `json:"crawl_time"`

	NetInfo map[string][]gocrawler.NetworkInfo `json:"network_info"`
	TIStats map[string][]CountryTableRow       `json:"ti_stats"`
}

Jump to

Keyboard shortcuts

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