We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

[Answered] Thumbnails and preview in newsfeed (dev help) | Forum

Umair
Umair May 5 '15
I want to add new websites to /ow_libraries/oembed/providers.php file. Oxwall dev team told me that you need to add new website links to this file to generate a preview in the newsfeed. I saw this file, but confused
The Forum post is edited by Alia May 15 '15
Alia Team
Alia May 14 '15
Umair, oEmbed is a library. You can find more information about it at: http://www.oembed.com/

Let's assume that you are  regular site user - thus "consumer".
And "Youtube" is provider.

When consumer adds a link to youtube video on your site, our script uses oembed library to fetch the preview. Our script can't build a preview if provider doesn't "give" us certain response and endpoint. So it is up to provider to pass certain response/piece of code when their content is being used in the web.

If you have a provider, who is not listed in providers.php file, we recommend contacting the provider directly and asking whether they support oembed and if yes, what you need to use to add them into your own  list.

Most of the large companies do have documentations. Ex: https://instagram.com/developer/embedding/ ( "Embedding for developers" section)

So try browsing though the web to find out whether content provider you are interested in has similar docs or not.
Umair
Umair May 15 '15
ok thanks. Now for example if you see dailymotion in this list http://www.oembed.com/#section7 How should I put it in providers.php file?

Secondly, Do you have newsfeed auto refresh code? Really, In my opinion, Reshare and autorefresh features are one of the most basic and desired features which oxwall lacks.
Alia Team
Alia May 18 '15
Try using following line:

OEmbed::addProvider( new OEmbedApiProvider('http://www.dailymotion.com/...:url&format=json', '~dailymotion\.com/video/.+~' ) );

You must also make sure that dailymotion.com provider is added to "Allowed resources list" in Admin Panel >> Settings >> Users Settings >> Content input.

Note: this modification might be erased if you update core platform in future.
Umair
Umair May 18 '15
ok thanks
Alia Team
Alia May 18 '15
Umair, in my previous reply the URL got shrunken.

Full URL is : http://www.dailymotion.com/services/oembed ; +  ?url=:url&format=json  part.

Our forum cuts of some symbols. Attaching screen shot of the line just in case:


Umair
Umair May 19 '15
ok thanks again