Skip to content

Commit

Permalink
Webmention logging complete. Fixes #30.
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongustafson committed Jul 7, 2017
1 parent 79d2509 commit ae7a1ab
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/jekyll/webmention_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,24 @@ def self.get_response(api_params)
end

def self.get_webmention_endpoint( uri )
log 'info', "Looking for webmention endpoint at #{uri}"
# log 'info', "Looking for webmention endpoint at #{uri}"
endpoint = Webmention::Client.supports_webmention?( uri )
if ! endpoint
log 'info', "No webmention endpoint at #{uri}"
end
# if ! endpoint
# log 'info', "No webmention endpoint at #{uri}"
# end
endpoint
end

def self.webmention( source, target, endpoint )
log 'info', "Sending webmention of #{target} in #{source} to #{endpoint}"
log 'info', "Sending webmention of #{target} in #{source}"
#return `curl -s -i -d \"source=#{source}&target=#{target}\" -o /dev/null #{endpoint}`
return Webmention::Client.send_mention( endpoint, source, target, true )
response = Webmention::Client.send_mention( endpoint, source, target, true )
if response
log 'info', "Webmention successful!"
else
log 'info', "Webmention failed, but will remain queued for next time"
end
response
end

# Utilities
Expand Down

0 comments on commit ae7a1ab

Please sign in to comment.