xrobotstag

package module
v0.0.0-...-4cd7d88 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: MIT Imports: 5 Imported by: 0

README

Build Status

X-Robots-Tag

This is a parser for X-Robots tags both in the header and within the html. Currently this is untested and has never run in production!

Usage

HTTP header

robotsTag := RobotsTag{}
RobotsTagFromHeaders(&resp.Header, "mybotname", &robotsTag)

Meta Tag

robotsTag := RobotsTag{}
RobotsTagFromHtmlTag(htmlNode, "mybotname", robotsTag)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RobotsTagFromHtmlTag

func RobotsTagFromHtmlTag(token *html.Node, botname string, parsedTag *RobotsTag) error

Types

type RobotsTag

type RobotsTag struct {
	All      bool
	Noindex  bool
	Nofollow bool
	// None is equivalent to noindex and nofollow. Omitted
	Noarchive        bool
	Nosnippet        bool
	Noodp            bool
	Notranslate      bool
	Noimageindex     bool
	UnavailableAfter *time.Time
}

func RobotsTagFromHeaders

func RobotsTagFromHeaders(header *http.Header, botname string) *RobotsTag

Jump to

Keyboard shortcuts

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