relme

package module
v1.0.1-0...-f5ef7dc Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 5 Imported by: 0

README

rel-me

See http://microformats.org/wiki/rel-me

Go
$ go get hawx.me/code/relme
import "hawx.me/code/relme"

me := "https://example.com/me"

links, _ := relme.Find(me)
for _, link := range links {
  if ok, _ := relme.LinksTo(link, me); ok {
    fmt.Printf("me=%s\n", link)
  }
}
Command line
$ go get hawx.me/code/relme/cmd/relme
$ relme https://example.com/me
...
$ relme -verified https://example.com/me
...

Documentation

Overview

Package relme provides functions to retrieve and verify profiles marked up with the rel="me" microformat.

See http://microformats.org/wiki/rel-me

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(profile string) (links []string, err error)

func FindAuth

func FindAuth(profile string) (links []string, err error)

func LinksTo

func LinksTo(remote, test string) (ok bool, err error)

func Verify

func Verify(profile string, links []string) (verifiedLinks []string, err error)

Types

type RelMe

type RelMe struct {
	Client *http.Client
}

func (*RelMe) Find

func (me *RelMe) Find(profile string) (links []string, err error)

Find takes a profile URL and returns a list of all hrefs in <a rel="me"/> elements on the page.

func (*RelMe) FindAuth

func (me *RelMe) FindAuth(profile string) (links []string, err error)

FindAuth takes a profile URL and returns a list of all hrefs in <a rel="me authn"/> elements on the page, if none are found then it will return a list of all hrefs in <a rel="me"/> elements instead.

func (*RelMe) LinksTo

func (me *RelMe) LinksTo(remote, test string) (ok bool, err error)

LinksTo takes a remote profile URL and checks whether any of the hrefs in <a rel="me"/> elements match the test URL.

func (*RelMe) Verify

func (me *RelMe) Verify(profile string, links []string) (verifiedLinks []string, err error)

Verify takes a profile URL and a list of profile links, and returns a list of all hrefs in <a rel="me"/> elements on the page that also link back to the profile.

Directories

Path Synopsis
cmd
relme
Command relme will retrieve all rel="me" links from a URL, and optionally verify that they also point back to the URL.
Command relme will retrieve all rel="me" links from a URL, and optionally verify that they also point back to the URL.

Jump to

Keyboard shortcuts

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