collectlinks

package
v0.0.0-...-fb85a1c Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package collectlinks does extraordinarily simple operation of parsing a given piece of html and providing you with all the hyperlinks hrefs it finds.

Index

Constants

View Source
const (
	SleepDuration = 1

	//XO ΧρυσοςΟδηγος
	XO = iota
	//VR Vrisko.gr
	VR
)

Variables

View Source
var SearchSite int

SearchSite The site you want goldenRuffian to search

Functions

func All

func All(httpBody io.Reader) []string

All takes a reader object (like the one returned from http.Get()) It returns a slice of strings representing the "href" attributes from anchor links found in the provided html. It does not close the reader passed to it.

func CollectMailsAsync

func CollectMailsAsync(in chan http.Response) chan string

CollectMailsAsync searches the pages provided in the channel for mails

func CollectNamesAndPhonesAsync

func CollectNamesAndPhonesAsync(in chan http.Response) chan string

CollectNamesAsync searches the pages provided in the channel for names

func CollectNamesAsync

func CollectNamesAsync(in chan http.Response) chan string

CollectNamesAsync searches the pages provided in the channel for names

func CollectPhonesAsync

func CollectPhonesAsync(in chan http.Response) chan string

CollectMailsAsync searches the pages provided in the channel for telephones

func FetchPagesAsync

func FetchPagesAsync(searchWord string, location string, pages string) chan http.Response

FetchPagesAsync fetches html page based on what, where and page number and puts them in a channel

func Names

func Names(httpBody io.Reader) []string

func SetSearchSite

func SetSearchSite(searchSite string) error

SetSearchSite set the website you want to search

Types

type Record

type Record struct {
	Name       string
	Telephones []string
}

Record is the data structure that contains the data extracted from pages TODO: Move this out of here

func NamesAndPhones

func NamesAndPhones(httpBody io.Reader) []Record

func (Record) String

func (r Record) String() string

Jump to

Keyboard shortcuts

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