News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Open Embed

Started by nend, February 29, 2016, 07:18:09 PM

Previous topic - Next topic

nend

Link to Mod

Open Embed is a BBCode that works with Open Graph, oEmbed and Meta information to embed media, such as videos or music, and site descriptions into your website post.

Instead of installing various mods to embed content from a web site you can embed content with this mod from any site that supports it with one simple BBC tag.

[embed]http://url.of.site/you/want/to/embed[/embed]

By placing the URL from the address bar in between the [embed][/embed] tags, this mod pulls Open Graph and Meta information shared freely from the site owner for display on your forum. By doing this your displaying the content the way the site author intended.

This mod caches the data in the database with a short TTL of only 30 days. This mod also uses the cache system with a TTL of 30 minutes.

Popular Supported Sites [Tested]
- Facebook
- MetaCafe
- YouTube
- Vimeo
- Vine

Live Examples
http://dev.sicomm.us/index.php?board=2.0;sort=subject

The sites that supply information for sharing their content are many. This is just a short list of sites that have been tested so far.

oEmbed Sites
Due to security concerns of the oEmbed standard, any site that shares its information via oEmbed must be added manually in the control panel in Modification Settings. You must add the site to the Allowed Sites list in the Open Embed menu.

For a list of oEmbed sites you can add to the white list, visit the link below.
http://oembed.com/#section6

Requirements
PHP 5.2 or greater

License
Copyright (c) 2015, Russell Najar (SiberInc)
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the SiberInc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

nend

If anyone wants me to test some links out please post them and I'll see if they are embeddable using open standards.

This would help with refining this modification and make sure it is complaint with these standards.

Also if a site doesn't support any of the web standards used in this modification, don't ask for it to be supported. It is up to the site owner if they want to incorporate these standards into their website. No special site specific support will be added to this modification.

Ninja ZX-10RR

This is *incredibly* interesting, I think I will give it a shot, but gotta do it on my test forum, as my production one has a *ton* of modifications to share stuff. This, however, could seriously replace all of them and potentially add more, which is stunning, I definitely love the idea and what you did here. Will see when I find some time and will try to help if possible.
Thank you for sharing this.
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

nend

Version 0.5.2 Released

+Finished support on whitelist

For full list of code changes
https://github.com/sicommnend/SMF-Open-Embed/commits/master

* Also uninstall old version before installing this one.  ::)

nend

I guess everything is running smoothly.

In any manner I found some bugs, not really bad bugs but some errors thrown in the log if a bad URL is embedded. Next release I say, but this is nothing really, just a annoyance.

Also I am planning 1.0. This would be a complete rewrite on how the data array is saved. This future release will make the array more streamline so it will be easier to manage in the future.

Ninja ZX-10RR

Didn't have the time to test it as I have been very busy IRL and with work. I guess I'll wait for v1, so I can clear out some other things and will be ready to try the new one :)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

nend

Right now I am unsure when I am going to get started on 1.0 as right now I am just planning on how the new array should be for it.

nend

0.5.3 Released.

Mainly bugfixes, fixed Dailymotion from autoplaying(Possibly others too) and fixed a typo that caused errors in the log.

It is recommended to "Remove all data associated with this modification." when you uninstall the mod to install the new one. This will remove all Dailymotion caches so the fixes would be applied immediately. If you don't do this you will have to wait for the caches to expire or manually delete them.  ;)

-Rock Lee-

@nend Great job I really like to help in translation but there are some questions I have that I see as translated properly before them :( As can the publicare :D


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

nend

Quote from: Rock Lee [BC] on April 05, 2016, 02:15:19 PM
@nend Great job I really like to help in translation but there are some questions I have that I see as translated properly before them :( As can the publicare :D


Regards!
Language strings are located in install.xml.

QuoteAs can the publicare
I am not sure what you mean here.

nend

You would figure Facebook would use Open Graph for sharing their content information, but they don't, they use oEmbed.

New fix I'll be releasing today fixes Facebook (post, pictures and video) and others that use oEmbed overflow problem.

Problem occurred when reusing code from the Open Graph section of the mod. oEmbed was always assumed as embedded video even though this isn't always the case.

Will be releasing a fix today.

-Rock Lee-

Quote from: nend on April 08, 2016, 08:44:15 AM
Language strings are located in install.xml.

Clear clear wanted translated into Latin Spanish but I have some doubts when translating such "Prune" would be like a fruit we eat around here so as not to give the sense of it all with my intermediate English ...

Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

nend

Quote from: Rock Lee [BC] on April 08, 2016, 09:25:11 AM
Quote from: nend on April 08, 2016, 08:44:15 AM
Language strings are located in install.xml.

Clear clear wanted translated into Latin Spanish but I have some doubts when translating such "Prune" would be like a fruit we eat around here so as not to give the sense of it all with my intermediate English ...

Regards!
In English prune could also mean purge or delete. ;)

Kindred

More specifically, prune means to trim --   like to prune a rose bush (to cut off small bits in order to promote better growth of the entire plant.)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

-Rock Lee-

#14
Quote from: nend on April 08, 2016, 10:19:01 AM
In English prune could also mean purge or delete. ;)

Modifications.spanish_latin.php

/* Open Graph Embed BBC */
$txt['scheduled_task_og_prune'] = 'Abrir embebido BBCode y/o modificar.';
$txt['scheduled_task_desc_og_prune'] = 'Elimina los datos de inserción que tiene más de 30 días a partir de la base de datos.';
$txt['og_settings'] = 'Configuración abrir embebido BBCode';
$txt['og_ext_chk'] = 'Activar comprobación de todos los objetos embebidos';
$txt['og_ext_chk_desc'] = 'Cuando no está marcada se establece en sitios sólo embebidos.';
$txt['og_allowed'] = 'Sitios permitidos';
$txt['og_allowed_desc'] = 'Uno por l&iacute;nea por ejemplo<br /><span style="color:#f00;"><b>sicomm.us<br />facebook.com</b></span>'


Modifications.spanish_latin-utf8.php

/* Open Graph Embed BBC */
$txt['scheduled_task_og_prune'] = 'Abrir embebido y/o modificar.';
$txt['scheduled_task_desc_og_prune'] = 'Elimina los datos de inserción que tiene más de 30 días a partir de la base de datos.';
$txt['og_settings'] = 'Configuración abrir embebido';
$txt['og_ext_chk'] = 'Activar comprobación de todos los objetos embebidos';
$txt['og_ext_chk_desc'] = 'Cuando no está marcada se establece en sitios sólo embebidos.';
$txt['og_allowed'] = 'Sitios permitidos';
$txt['og_allowed_desc'] = 'Uno por línea por ejemplo<br /><span style="color:#f00;"><b>sicomm.us<br />facebook.com</b></span>'


Thank you now if you can interpret :D I hope now if you look good ;)


Regards!

Edit:
Quote from: Kindred on April 08, 2016, 11:23:17 AM
More specifically, prune means to trim --   like to prune a rose bush (to cut off small bits in order to promote better growth of the entire plant.)

Now if thank you very much more learned something new :D Now I add a little change as there is a change if you put it that way ;)


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

nend

0.5.5
0.5.5 update includes a workaround to skip Flash entries in Open Graph information. Chrome and maybe others will completely drop Flash support soon. Since Open Embed takes the last entry in OG information, sites like YouTube will quit working in Open Embed 0.5.4 and below. Install this update to keep your embeds working.

GirlinGray

This is great I have been going crazy looking for anything that embeds an open graph description and images to posted links and this is the first and best mod I've found. I've installed and it's working.

The problem I'm having with it is it is the images are appearing real size in the forum. In some cases, this means the open graph images accompanying the links are huge.

Are there plans to compensate for or correct this to minimize the size of images attached to online articles?

There's also no forum menu item for forum members to use for embeds, so while I and administrators know this function is present and how to use the embed command, forum members aren't going to know they have an embed link option.

Right now I'm only running the mod through its paces on Safari, I haven't tried it out yet in Chrome, it may be different in a different browser.

Really smart mod.

That Adams Girl

GirlinGray

Safari seems to be condensing the links now but Chrome is still blowing the images up to full size coming off the linked site. Hmm.
That Adams Girl

Sesquipedalian

Nice looking mod, nend. Here's a feature request:

It'd be great if the mod could automatically detect URLs of supported sites that appear on their own line and wrap them in [embed] tags.

For example, if a user enters this:


Check out this video!

https://www.youtube.com/watch?v=OE8WzYNRPNU


... then in (or before) the auto-linking stage of parse_bbc(), it would be transformed into this:


Check out this video!

[embed]https://www.youtube.com/watch?v=OE8WzYNRPNU[/embed]


To avoid formatting problems I would suggest that this only be done for URLs on their own line.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

shadav

this works great, thank you

only issue is.... it's not really responsive :D

how can I make it so that it resizes based on browser size?

Advertisement: