Add web mentions

This commit is contained in:
2023-02-18 16:52:10 +11:00
parent d1af1cac6a
commit 5b694f77cd
3 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
require "httparty"
module Adamantium
module Commands
module Posts
class SendWebmentions
include Deps["settings", "post_utilities.link_finder"]
def call(post_content:, post_url:)
source = post_url
links = link_finder.call(post_content)
links.each do |target|
HTTParty.post(settings.webmention_service, {
token: settings.webmention_token,
source: source,
target: target
})
end
end
end
end
end
end