Method: Webmention.send_webmention

Defined in:
lib/webmention.rb

.send_webmention(source, target, vouch: nil) ⇒ Webmention::Response, Webmention::ErrorResponse

Send a webmention from a source URL to a target URL.

Examples:

Send a webmention

source = 'https://jgarber.example/posts/100'
target = 'https://aaronpk.example/notes/1'
Webmention.send_webmention(source, target)

Send a webmention with a vouch URL

source = 'https://jgarber.example/posts/100'
target = 'https://aaronpk.example/notes/1'
Webmention.send_webmention(source, target, vouch: 'https://tantek.example/notes/1')

Parameters:

  • source (String, HTTP::URI, #to_s)

    An absolute URL representing a source document.

  • target (String, HTTP::URI, #to_s)

    An absolute URL representing a target document.

  • vouch (String, HTTP::URI, #to_s) (defaults to: nil)

    An absolute URL representing a document vouching for the source document. See indieweb.org/Vouch for additional details.

Returns:



61
62
63
# File 'lib/webmention.rb', line 61

def self.send_webmention(source, target, vouch: nil)
  Client.new(source, vouch: vouch).send_webmention(target)
end