SMFHacks.com

Modifications/Themes => Modifications Talk => Latest Mods => Topic started by: nend on February 03, 2016, 07:50:45 pm

Title: [Mod]Open Embed
Post by: nend on February 03, 2016, 07:50:45 pm
Open Embed

http://www.smfhacks.com/index.php?action=downloads;sa=view;down=184

Open Embed is a BBCode that works with Open Graph 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

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.

Requirements
PHP 5 or greater

Changelog:
0.1

- Initial pre-release

0.2
! Moved cache_put for a successful database call to the if statement for max-age to prevent stale data from being cached.
+ Added support for HTML 5 video and audio.
+ Added fallback support for text/html video to iframe.
! Moved $data = array() to else statement.
- Removed HTML 5 video support as it isn't fully supported.
+ Added some more meta phasing for og:video:url
+ Added code to disregard text/html video.
+ Added scheduled task to purge old data.
- Remove update support from main function.
! Renamed modification to Open Embed.
! Fixed errors with xpath when property isn't found.

0.3
+ Added some support to remove autoplay from url string.
+ Added oEmbed JSON support. (Only in a iframe via JavaScript as any other option isn't wise)
! Updated install with Margaretts suggestions.
! Changed video support from iframe to embed
+ Added useragent string. (Some sites are back in the 00s, browser discrimination it's called.)
+ Other stuff I may have forgotten...

0.4
- Removed JavaScript iFrame for oEmbed as it wasn't always working right and may be insecure.
+ Added a allowed list of trusted sites mainly for oEmbed.
! Fixed bug in oEmbed with initial json_decode as it wasn't set to be returned as a array.