wikipedia

package
v0.0.0-...-b28cec7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEdgesIfDoNotExist

func AddEdgesIfDoNotExist(
	currentNode string,
	neighborNodes []string,
) (
	neighborsAdded []string,
	err error,
)

adds edge to DB, returns new neighbors added (to crawl on)

func CleanUrl

func CleanUrl(link string) string

decodes and standaridizes URL

func FilterPage

func FilterPage(e *colly.HTMLElement) (*colly.HTMLElement, error)

filters down full page body to elements we want to focus on

func GetRandomNode

func GetRandomNode() (string, error)

gets random article from metawiki API returns article in the form "/wiki/XXXXX"

func IsValidCrawlLink(link string) bool

determines if is good link to crawl on

Types

type Page

type Page struct {
	Title string `json:"title"`
}

type RArticleResp

type RArticleResp struct {
	Query RQuery `json:"query"`
}

type RQuery

type RQuery struct {
	Pages map[string]Page `json:"pages"`
}

Jump to

Keyboard shortcuts

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