Advertisement:

Author Topic: Open Embed  (Read 8854 times)

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Open Embed
« on: February 29, 2016, 07:18:09 PM »
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.

Code: [Select]
[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.

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #1 on: March 07, 2016, 07:55:59 AM »
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.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,244
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Open Embed
« Reply #2 on: March 13, 2016, 08:40:44 AM »
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

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #3 on: March 15, 2016, 09:41:14 PM »
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.  ::)

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #4 on: March 31, 2016, 11:04:58 PM »
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.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,244
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Open Embed
« Reply #5 on: March 31, 2016, 11:58:23 PM »
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

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #6 on: April 01, 2016, 12:32:23 AM »
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.

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #7 on: April 04, 2016, 06:32:28 PM »
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.  ;)

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,915
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Open Embed
« Reply #8 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!
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #9 on: April 08, 2016, 08:44:15 AM »
@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.

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

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #10 on: April 08, 2016, 09:03:22 AM »
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.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,915
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Open Embed
« Reply #11 on: April 08, 2016, 09:25:11 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 © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #12 on: April 08, 2016, 10:19:01 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. ;)

Offline Kindred

  • The Mean One
  • Lead Support Specialist
  • SMF Legend
  • *
  • Posts: 60,434
  • Gender: Male
    • Kindred-999 on GitHub
Re: Open Embed
« Reply #13 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.)
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."

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,915
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Open Embed
« Reply #14 on: April 08, 2016, 11:29:54 AM »
In English prune could also mean purge or delete. ;)

Modifications.spanish_latin.php

Code: [Select]
/* 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

Code: [Select]
/* 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:
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!
« Last Edit: April 08, 2016, 11:42:06 AM by Rock Lee [BC] »
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline nend

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,755
  • 2 deep n2 the code
    • sicommnend on GitHub
    • SIComm.us
Re: Open Embed
« Reply #15 on: August 12, 2016, 07:18:33 PM »
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.

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 74
  • Go big or stay home.
    • SeeMaxRun
Re: Open Embed
« Reply #16 on: December 10, 2016, 05:00:13 AM »
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

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 74
  • Go big or stay home.
    • SeeMaxRun
Re: Open Embed
« Reply #17 on: December 10, 2016, 05:42:11 AM »
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

Online Sesquipedalian

  • The Mad Doctor
  • Lead Developer
  • Sophist Member
  • *
  • Posts: 1,238
  • Gender: Male
  • It works! ... in theory.
    • Sesquipedalian on GitHub
Re: Open Embed
« Reply #18 on: January 24, 2017, 04:37:01 PM »
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:

Code: [Select]
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:

Code: [Select]
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.

Offline shadav

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,543
  • Gender: Female
    • shadav on Facebook
    • leashadav on GitHub
    • Foamy Fanatics :: For All Your Foamy The Squirrel Needs
Re: Open Embed
« Reply #19 on: September 18, 2019, 07:12:18 PM »
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?