Youtube Onebox revisited

Go for it. a custom onebox is a good place to start i.e.

  • Save a file whatever_name_onebox.rb in the lib/onebox/engine folder
module Onebox
  module Engine
    class WhateverNameOnebox
      include Engine
 
      matches_regexp /^http:\/\/www\.domian\.com\/forums\/.*/
 
      def to_html
        "<iframe src='#{@url}' style='border-width:0' frameborder='0' scrolling='no' width='100%'></iframe>"
      end
    end
  end
end

Regex might be tricky, and I hope you have better design skills than I do, but this will hopefully give you a starting point.

* my iframe line is a single but it got crunched here.

2 Likes