about summary refs log tree commit diff stats
path: root/app/jobs/send_webmentions_job.rb
blob: 359f5b65ee85c8a1af59de00d53ecef9b41a5aa8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'webmention'

class SendWebmentionsJob < ApplicationJob
  queue_as :default

  def perform(blog)
    source = Rails.application.routes.url_helpers.blog_url(blog, host: "www.fourisland.com")
    urls = Webmention.mentioned_urls(source)
    urls.each do |url|
      Webmention.send_webmention(source, url)
    end
  end
end