fixup! Add web mentions

This commit is contained in:
2023-02-18 16:53:46 +11:00
parent c629b49c2d
commit c92428617c

View File

@@ -0,0 +1,21 @@
require "uri"
module Adamantium
class LinkFinder
IGNORE_LIST = %w[twitter.com
instagram.com
google.com
overcast.fm
youtube.com
github.com]
def call(content)
links = URI::DEFAULT_PARSER.extract(content)
links.reject do |link|
link.end_with?(":") ||
IGNORE_LIST.include?(URI.parse(link).host)
end
end
end
end