How can I implement a onebox myself?


(Roy Guo) #1

Onebox is awesome, now I want to implement it for youku.com and tudou.com, which are china’s youtube.

Since I’m not a ruby developer, I wonder if these steps are right(e.g. youku.com):

  1. Add the site’s url into whitelist.rb.
  2. Copy the ted_onebox.rb to youku_onebox.rb
  3. Change class name to YoukuOnebox in youku_onebox.rb.
  4. Custom the return string.

Is that right ? It doesn’t work for me yet. The custom string looks like this:

<embed src='http://player.youku.com/player.php/sid/XMzU4MTUyOTMy/v.swf' allowFullScreen='true' quality='high' width='480' height='400' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash'></embed>

How to support China video site?
(Jeff Atwood) #2

Do these sites support OpenGraph? If they do, you might not need to do anything at all…

OpenGraph compliant sites “just work”, provided they are on the URL whitelist.


(Roy Guo) #3

I don’t think they support OpenGraph since it doen’t work when I paste their URL.

So … anyway… Did I add onebox the correct way ? It didn’t work yet.


(Jeff Atwood) #4

You must add them to the whitelist, as well. You can use a third party open graph checking tool to see if they support it first.


#5

@royguo have you sovled this issue?