Onebox Does Not Display - iFramely Passes

I have noticed very few sites I attempt to use a Onebox for are not working. I checked
https://blog.scoutingmagazine.org/2016/11/03/the-boy-scout-board-of-review-everything-you-need-to-know/

against iframely.com and it displays as expected. iframely.com/debug does not indicate any errors.

Is there something else I can check?

2 Likes

My guess is you are having your crawl rejected (and this is happening here on meta too).

But I have a solution, but it’s not 100% free:

I just tested this on two of my sites, one equipped with the plugin, and one without, and it works on the one equipped.

My pleasure! :wink:

One of the issues here is that Discourse/Onebox could be a heck of a lot more transparent about the way it handles a failure. I guess that’s a stretch feature, but it would be nice if there was more feedback to the user pasting the link (or even just the admins).

I checked my /logs on the site which failed and do not see any extra information wrt to the failed preview …

1 Like

This is funny, that site blocks “forum” in the User Agent:

Works:

  • Discourse
  • Discourse Onebox
  • Discourse Onebox v1.8.0.beta13

Don’t Work:

  • Discourse Forum Onebox v1.8.0.beta13
  • Discourse Forum Onebox
  • Discourse Forum
  • Forum
5 Likes

Yes, I can reproduce that from a VPS using curl -A "-string-"! Can we have a setting to change the user agent? :wink:

In this case that would be a lot less hassle :slight_smile:

Oh wait, I see a file:

discourse/config/initializers/100-onebox_options.rb

require_dependency 'twitter_api'

Onebox.options = {
  twitter_client: TwitterApi,
  redirect_limit: 3,
  user_agent: "Discourse Forum Onebox v#{Discourse::VERSION::STRING}"
}

Take the word forum out?

I could easily add this to my plugin of course …

3 Likes