cypherhunterscrapper

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 6 Imported by: 0

README

cypherhunter scrapper

GoDoc codecov

This is the package that provides functions to scrape information from cypherhunter.com pages

Documentation

Overview

This is the package that provides functions to scrape information from cypherhunter.com pages

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInvestorsAll

func GetInvestorsAll(requester Requester) ([]string, error)

GetInvestorsAll gives list of all investors from coin page given by Request() of Requester interface.

Returns array of string with investor names and possibly nil error

Types

type CoinRequester added in v1.1.1

type CoinRequester struct {
	// contains filtered or unexported fields
}

CoinRequester is the struct containing coinUrl to be requested

func NewCoinRequester added in v1.1.1

func NewCoinRequester(coinUrl string) (CoinRequester, error)

NewCoinRequester gives new value of type CoinRequester. Before creating CoinRequester checks if input url is valid cypherhunter.com url.

Returns new CoinRequester with url and nil error if url is valid else empty CoinRequester and error

Example
rawUrl := "  https://www.cypherhunter.com/en/p/solana/   "
cr, err := NewCoinRequester(rawUrl)
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v", cr)
Output:
cypherhunterscrapper.CoinRequester{coinUrl:"https://www.cypherhunter.com/en/p/solana/"}

func (CoinRequester) Request added in v1.1.1

func (c CoinRequester) Request() (string, error)

Implements function Request() of Requester interface

type Investor added in v1.0.3

type Investor struct {
	Name   string
	Link   string
	Tier   string
	TierId int
}

Investor is how the cypherhunterscrapper package stores an information about the investor

func GetInvestorsExceptional added in v1.1.0

func GetInvestorsExceptional(investors []string) []Investor

GetInvestorsExceptional finds top investors in list of investors names.

Returns possibly empty list of top investors of type Investor

func InListOfTop added in v1.1.0

func InListOfTop(name string) (Investor, bool)

InListOfTop gives Investor if passed name is in list of top investors. Is preferred to be used in Comma Ok Idiom.

Returns Investor and bool meaning that the name is on the list of top investors

Example
name := "Polychain Capital"
investor, ok := InListOfTop(name)
if ok {
	fmt.Printf("%#v", investor)
}
Output:
cypherhunterscrapper.Investor{Name:"Polychain Capital", Link:"https://www.cypherhunter.com/en/p/polychain-capital/", Tier:"Premier", TierId:0}

type Requester added in v1.1.1

type Requester interface {
	Request() (string, error)
}

Requester is the interface that requests cypherhunter.com using github.com/anaskhan96/soup

Jump to

Keyboard shortcuts

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