webmention

package module
v0.0.0-...-2c9f182 Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: BSD-3-Clause Imports: 9 Imported by: 0

README

webmention Build Status GoDoc BSD License

webmention is a go library and command line tool for assisting in sending webmentions.

Install the library by running:

go get willnorris.com/go/webmention

To install the command line tool, run:

go get willnorris.com/go/webmention/cmd/webmention

License

This library is copyright Google, but is not an official Google product. It is available under a BSD License.

Documentation

Overview

Package webmention provides functions for discovering the webmention endpoint for URLs, and sending webmentions according to http://webmention.org/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverLinksFromReader

func DiscoverLinksFromReader(r io.Reader, baseUrl string, sel string) ([]string, error)

DiscoverLinksFromReader discovers URLs in the HTML read from 'r'. Relative URLs found the HTML are resolved against 'baseUrl'. These are candidates for sending webmentions to. If non-empty, sel is a CSS selector identifying the root node(s) to search in for links.

Types

type Client

type Client struct {
	*http.Client
}

Client is a webmention client that can discover webmention endpoints and send webmentions.

func New

func New(client *http.Client) *Client

New constructs a new webmention Client using the provided http.Client. If a nil http.Client is provided, http.DefaultClient is used.

func (*Client) DiscoverEndpoint

func (c *Client) DiscoverEndpoint(urlStr string) (string, error)

DiscoverEndpoint discovers the webmention endpoint for the provided URL.

func (c *Client) DiscoverLinks(urlStr string, sel string) ([]string, error)

DiscoverLinks discovers URLs that the provided resource links to. These are candidates for sending webmentions to. If non-empty, sel is a CSS selector identifying the root node(s) to search in for links.

func (*Client) SendWebmention

func (c *Client) SendWebmention(endpoint, source, target string) (*http.Response, error)

SendWebmention sends a webmention to endpoint, indicating that source has mentioned target.

Directories

Path Synopsis
cmd
webmention-cli
The webmention binary is a command line utiltiy for sending webmentions to the URLs linked to by a given webpage.
The webmention binary is a command line utiltiy for sending webmentions to the URLs linked to by a given webpage.
third_party
header
Package header provides functions for parsing HTTP headers.
Package header provides functions for parsing HTTP headers.

Jump to

Keyboard shortcuts

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