Simple example for plugin to change files?

This is a technique known as “monkey patching”. There are several ways to accomplish this but the easiest is to just define the method you want to replace in your plugin.

after_initialize do
  class ::TopicEmbed
    def self.imported_from_html(url)
       # your code
    end
  end
end