goseo

package module
v0.0.0-...-6289f5f Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

README

go-seo

A Go tool to provide SEO advice for a specified domain.

Usage

An example of validating a H1 length can be performed by running:

> go run example/example.go https://dant.blog

Sample output:

SEO advice for: https://dant.blog

H1 currently: 'Dan's Blog'
H1 feedback: The H1 is too short, aim for 20 characters minimum.
H2 count: 18
H3 count: 7
H4 count: 0
Internal links found: 20
External links found: 15

Improvements

  • Add more analyser options and useful advice
  • Add ability to validate inbound / outbound links
  • Persist results to a database
  • Improve memory handling of results

Documentation

Index

Constants

View Source
const H1LongError = "The H1 is too long, aim for 70 characters maximum."
View Source
const H1ShortError = "The H1 is too short, aim for 20 characters minimum."

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyse

type Analyse struct {
	Report []Report
}

func (Analyse) CheckH1Length

func (a Analyse) CheckH1Length(h1 string) Report

type Analyser

type Analyser interface {
	CheckH1Length()
}

type Crawler

type Crawler struct{}

func (Crawler) Crawl

func (c Crawler) Crawl(url string) (string, error)

type CrawlerWork

type CrawlerWork interface {
	Crawl() (body string, err error)
}

type Parser

type Parser struct{}

func (Parser) GetAllElements

func (p Parser) GetAllElements(rawHtml string, element string, raw bool) []string

func (Parser) GetAllLinkHrefs

func (p Parser) GetAllLinkHrefs(rawHtml string) []string

func (Parser) GetFirstElement

func (p Parser) GetFirstElement(rawHtml string, element string, raw bool) (string, error)

type ParserChecks

type ParserChecks interface {
	GetAllLinkHrefs()
	GetFirstElement()
	GetAllElements()
}

type Report

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

func (Report) GetFeedback

func (r Report) GetFeedback() []string

func (Report) Passed

func (r Report) Passed() bool

type Reporter

type Reporter interface {
	AddFeedback()
	GetFeedback()
}

type Spider

type Spider struct {
	Recursive bool
}
func (s Spider) GetLinks(url string, depth int) map[string]*Url

type SpiderWeb

type SpiderWeb interface {
	GetLinks()
}

type Url

type Url struct {
	Url      string
	Links    []string
	Crawled  bool
	Depth    int
	Internal bool
}

type UrlList

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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