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 ¶
- func Version() string
- type MetaInspector
- func (m MetaInspector) Author() string
- func (m MetaInspector) Charset() string
- func (m MetaInspector) Compatibility() map[string]string
- func (m MetaInspector) Description() string
- func (m MetaInspector) Feed() string
- func (m MetaInspector) Generator() string
- func (m MetaInspector) Host() string
- func (m MetaInspector) Images() []string
- func (m MetaInspector) Keywords() []string
- func (m MetaInspector) Language() string
- func (m MetaInspector) Links() []string
- func (m MetaInspector) RootURL() string
- func (m MetaInspector) Scheme() string
- func (m MetaInspector) Title() string
- func (m MetaInspector) Url() string
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) 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) 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
Click to show internal directories.
Click to hide internal directories.