meta

package module
v0.0.0-...-9082122 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2017 License: MIT Imports: 6 Imported by: 0

README

Metameta

Build Status Build status Coverage Status Go Report Card GoDoc

Overview

Retrieves meta tags from Websites.

sample
[
    {
        "index": "charset",
        "name": "utf-8",
        "content": ""
    },
    {
        "index": "http-equiv",
        "name": "Content-type",
        "content": "text/html; charset=utf-8"
    },
    {
        "index": "name",
        "name": "viewport",
        "content": "width=device-width, initial-scale=1"
    }
]

License & Authors

  • Author:: @sakajunquality
  • License:: MIT

Documentation

Index

Constants

View Source
const (
	// MetaIndexCharset is attribute name for charset
	MetaIndexCharset = "charset"
	// MetaIndexName is attribute name for name
	MetaIndexName = "name"
	// MetaIndexProperty is attribute name for property
	MetaIndexProperty = "property"
	// MetaIndexHttpEquiv is attribute name for http-equiv
	MetaIndexHttpEquiv = "http-equiv"
)

Variables

This section is empty.

Functions

func GetHTMLContent

func GetHTMLContent(targetURL string) string

GetHTMLContent gets HTML DOM and returns it as string

func JSONStringfyMeta

func JSONStringfyMeta(metas Metas) (string, error)

JSONStringfyMeta changes Metas to json string

Types

type Meta

type Meta struct {
	Index   string `json:"index"`
	Name    string `json:"name"`
	Content string `json:"content"`
}

Meta is the unit for parsed meta tag

type Metas

type Metas []Meta

Metas contains all the meta

func ParseMetaData

func ParseMetaData(html string) Metas

ParseMetaData retrieves meta tags from html string

Jump to

Keyboard shortcuts

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