metainspector

package
v0.0.0-...-a4860c8 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2014 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

go-metainspector is a web scraper package that provides access to basic info and meta tags of a given URL. It includes a command line tool as well. It is inspired by the metainspector gem (https://github.com/jaimeiniesta/metainspector) and completely written in Go. You will find more info on the README file and the `examples` directory.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Version of the package

Types

type MetaInspector

type MetaInspector struct {
	// contains filtered or unexported fields
}
Example
url := "http://www.cloudcontrol.com/pricing"
MI, err := New(url)
if err != nil {
	fmt.Printf("Error: %v", err)
} else {
	fmt.Printf("\nURL: %s\n", MI.Url())
	fmt.Printf("Scheme: %s\n", MI.Scheme())
	fmt.Printf("Host: %s\n", MI.Host())
	fmt.Printf("Root: %s\n", MI.RootURL())
	fmt.Printf("Title: %s\n", MI.Title())
	fmt.Printf("Language: %s\n", MI.Language())
	fmt.Printf("Author: %s\n", MI.Author())
	fmt.Printf("Description: %s\n", MI.Description())
	fmt.Printf("Charset: %s\n", MI.Charset())
	fmt.Printf("Feed URL: %s\n", MI.Feed())
	fmt.Printf("Links: %v\n", MI.Links())
	fmt.Printf("Images: %v\n", MI.Images())
	fmt.Printf("Keywords: %v\n", MI.Keywords())
	
Output:

URL: http://www.cloudcontrol.com/pricing
Scheme: http
Host: www.cloudcontrol.com
Root: http://www.cloudcontrol.com
Title: cloudControl » Cloud App Platform » Pricing
Language: en
Author: cloudControl GmbH
Description: Cloud hosting secure, easy and fair: Highly available and scalable cloud hosting with no administraton hassle and pay as you go billing
Charset: utf-8
Feed URL: https://www.cloudcontrol.com/blog.rss
Links: [http://www.cloudcontrol.com/console/account/{{user.username}} http://www.cloudcontrol.com/ http://www.cloudcontrol.com/pricing http://www.cloudcontrol.com/dev-center http://www.cloudcontrol.com/add-ons http://www.cloudcontrol.com/blog http://www.cloudcontrol.com/console http://www.cloudcontrol.com/pricing/calculator http://www.cloudcontrol.com#included http://www.cloudcontrol.com#memoryhours http://www.cloudcontrol.com#included http://www.cloudcontrol.com#memoryhours http://www.cloudcontrol.com#included http://www.cloudcontrol.com#memoryhours http://www.cloudcontrol.com#included http://www.cloudcontrol.com#memoryhours http://www.cloudcontrol.com/sign-up http://www.cloudcontrol.com/pricing/calculator http://www.cloudcontrol.com/sign-up?plan=Start-up http://www.cloudcontrol.com/pricing/calculator?plan=startup http://www.cloudcontrol.com/sign-up?plan=Business http://www.cloudcontrol.com/pricing/calculator?plan=business http://www.cloudcontrol.com/sign-up?plan=Business%2B http://www.cloudcontrol.com/pricing/calculator?plan=businessplus http://www.cloudcontrol.com/contact http://www.cloudcontrol.com#plantable http://www.cloudcontrol.com#plantable http://www.cloudcontrol.com/dev-center/Quickstart http://www.cloudcontrol.com/dev-center/Platform Documentation http://status.cloudcontrol.com http://www.cloudcontrol.com/dev-center/support http://www.cloudcontrol.com/console http://www.cloudcontrol.com/team http://www.cloudcontrol.com/jobs http://www.cloudcontrol.com/blog http://www.cloudcontrol.com/contact http://www.cloudcontrol.com/add-on-provider-program http://www.cloudcontrol.com/solution-provider-program http://www.whitelabelpaas.info http://www.cloudcontrol.com/tos http://www.cloudcontrol.com/privacy-policy http://www.cloudcontrol.com/imprint]
Images: [http://www.cloudcontrol.com/assets/spinner-6f9309f477dcc1d3c21cd21ce44dc8b2.gif]
Keywords: [cloudcontrol cloud control cloud hosting cloud computing cloud hosting web-hosting platform as a service paas]

func New

func New(uri string) (*MetaInspector, error)

New creates an object with all the URL scraped info

func (MetaInspector) Author

func (m MetaInspector) Author() string

Author of the site

func (MetaInspector) Charset

func (m MetaInspector) Charset() string

Charset of the site

func (MetaInspector) Compatibility

func (m MetaInspector) Compatibility() map[string]string

Compatibility con browsers. specially with IE

func (MetaInspector) Description

func (m MetaInspector) Description() string

Description of the site

func (MetaInspector) Feed

func (m MetaInspector) Feed() string

Feed link of the site

func (MetaInspector) Generator

func (m MetaInspector) Generator() string

Generator of the site

func (MetaInspector) Host

func (m MetaInspector) Host() string

Host of the URL

func (MetaInspector) Images

func (m MetaInspector) Images() []string

Images located on the site

func (MetaInspector) Keywords

func (m MetaInspector) Keywords() []string

Keywords of the site

func (MetaInspector) Language

func (m MetaInspector) Language() string

Language of the site

func (m MetaInspector) Links() []string

Links found on the site

func (MetaInspector) RootURL

func (m MetaInspector) RootURL() string

RootURL, with no path and slashes

func (MetaInspector) Scheme

func (m MetaInspector) Scheme() string

Scheme of the URL, `http` by default

func (MetaInspector) Title

func (m MetaInspector) Title() string

Title of the site

func (MetaInspector) Url

func (m MetaInspector) Url() string

Url provided by the Metainspector

Jump to

Keyboard shortcuts

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