What it does
Turns this kind of result:
(where your server has failed to bring back the page source so cannot extract the required tags to build the onebox)
It simply provides an alternative path for onebox to get its page source with which to look for meta-data when the target server refuses your connection.
It changes nothing about how onebox then processes the page source to find the meta-data and render the box.
It’s meant to allow you to enter the details and credentials of a third party API to bring back the page instead of doing a normal http call directly to the target page.
I found my servers were being forbidden access to a number of commercial sites so oneboxes would fail to be rendered. It essentiallly helps leverage the trustworthiness of the 3rd party API, a bit like a mail service.
Why it’s cost effective
It is intended to use the API sparingly and will bring back the page source in the normal way under most circumstances. It only uses the API when it’s refused a response.
What this means is you can use a relatively cheap VPS but still get reliable one-boxing functionality, even if your IP or user agent is somehow ‘blacklisted’.
You don’t need it if
You are oneboxing all your target content ok with the vanilla install and all users are happy
You need an account with a suitable 3rd part API.
See example below
- It’s only been tested with one provider at the moment and not tested on others. That provider is https://embed.rocks (with whom I have no affiliation). I’m happy to consider supporting more services if the work is sponsored.
There’s a switch to return page source.
- The monkeypatching is a little brash and there’s rather too much Discourse code in the current version. Advice on how to minimise the amount of original source-code most welcome!
All feedback welcome.