Sha256: 2e54aab1f733eda890d32ee424713453d1a352e3ae4afc8374538e5a38e5a5b3

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

module IndieWeb
  module Endpoints
    module Parsers
      class WebmentionParser < BaseParser
        @identifier = :webmention

        Parsers.register(self)

        private

        def results_for_node(node)
          Services::ResponseParserService.parse_body(parsed_response_body, self.class.identifier, node)
        end

        # https://www.w3.org/TR/webmention/#sender-discovers-receiver-webmention-endpoint
        def results_from_body
          @results_from_body ||= [results_for_node('link'), results_for_node('a')].flatten.compact
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
indieweb-endpoints-6.1.0 lib/indieweb/endpoints/parsers/webmention_parser.rb
indieweb-endpoints-6.0.0 lib/indieweb/endpoints/parsers/webmention_parser.rb