class Plag
  include Anemon

  @anemon = Anemon::Scrapper.new

  def self.scrap(url)
    @anemon.scrap(url)
  end

  def self.compare(file_name)
    @anemon.compare(url)
  end
end

class Plag < ApplicationRecord
  include Anemon

  @anemon = Anemon::Scrapper.new

  def self.scrap(url)
    result = @anemon.scrap(url)
    Plag.create({url: result[:url], content: result[:content]}) if result
  end

  def self.compare(file_name)
    @anemon.compare(url)
  end
end

Save the scrapped url and its contents to the db
Save the scrapped url and its contents to the db
