def ping(source_uri, target_uri)
      header = request_header target_uri
      pingback_server = header['X-Pingback']

      unless pingback_server
        doc = Nokogiri::HTML(request_all(target_uri).body)
        link = doc.xpath('//link[@rel="pingback"]/attribute::href').first
        pingback_server = URI.escape(link.content) if link
      end

      raise InvalidTargetException unless pingback_server

      send_pingback pingback_server, source_uri, target_uri
    end
def ping(source_uri, target_uri)
      header = request_header target_uri
      pingback_server = header['X-Pingback']

      unless pingback_server
        doc = Nokogiri::HTML(request_all(target_uri).body)
        link = doc.xpath('//link[@rel="pingback"]/attribute::href').first
        pingback_server = URI.escape(link.content) if link
      end

      raise InvalidTargetException unless pingback_server

      send_pingback pingback_server, source_uri, target_uri
    end
send an pingback request to the targets associated pingback server.

 @param [String] source_uri the address of the site containing the link.
 @param [String] target_uri the target of the link on the source site.
 @raise [Pingback::InvalidTargetException] raised if the target is not a pingback-enabled resource
 @raise [XMLRPC::FaultException] raised if the server responds with a faultcode
 @return [String] message indicating that the request was successful