/*
Plugin Name: Distrify Embed
Plugin URI: http://support.distrify.com/customer/portal/articles/264106-how-do-i-embed-on-a-wordpress-blog-
Description: Extends WordPress's Embeds allowing bloggers to easily embed videos from Distrify. Just go to any Distrify film page or player and copy the URL. Paste that URL in any WordPress blog and it will automatically be converted to an embedded Distrify player. If you are logged in to distrify.com it will automatically add your affiliate tracking code to your embeds. Make sure you turn on Auto-embeds in your WP settings and also make sure that the URL is on its own line and not hyperlinked (clickable when viewing the post). The plugin also extracts the still image from the film and saves it as the Featured Image for the post. This actually works for any Embed (not just Distrify) that you embed into your WordPress blog.
Author: Distrify Limited
Version: 0.3.1
Author URI: http://www.distrify.com
License: GPL2
Copyright 2011-2013 Distrify (email : hello@distrify.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* Does the work of adding the Distrify provider to wp_oembed
*/
function add_distrify_provider($the_content){
require_once( ABSPATH . WPINC . '/class-oembed.php' );
wp_oembed_add_provider('#https?://(www\.)?(distrify|muvies).com/films/.*#i', 'http://distrify.com/oembed.json', true );
wp_oembed_add_provider('http://muvi.es/*', 'http://distrify.com/oembed.json' );
wp_oembed_add_provider('#https?://.*\.muvies.com/.*reviews/.*#i', 'http://distrify.com/oembed.json', true );
}
//add the provider on plugins_loaded.
add_action('plugins_loaded', 'add_distrify_provider');
/**
* from http://wordpress.stackexchange.com/q/70752/1685
* Automatically set the featured image if an oEmbed-compatible embed is found in the post content.
* author: TheDeadMedic
* author URI: http://wordpress.stackexchange.com/users/1685/thedeadmedic
*
*/
add_action( 'wp_insert_post', array( 'ofi', 'init' ) );
class ofi
{
/**
* The post thumbnail ID
*
* @var int
*/
private $_thumb_id;
/**
* The post ID
*
* @var int
*/
private $_post_id;
/**
* Sets up an instance if called statically, and attempts to set the featured
* image from an embed in the post content (if one has not already been set).
*
* @param int $post_id
* @return object|null
*/
public function init( $post_id )
{
if ( ! isset( $this ) )
return new ofi( $post_id );
global $wp_embed;
$this->_post_id = absint( $post_id );
if ( ! $this->_thumb_id = get_post_meta( $this->_post_id, '_thumbnail_id', true ) ) {
if ( $content = get_post_field( 'post_content', $this->_post_id, 'raw' ) ) {
add_filter( 'oembed_dataparse', array( $this, 'oembed_dataparse' ), 10, 3 );
$wp_embed->autoembed( $content );
remove_filter( 'oembed_dataparse', array( $this, 'oembed_dataparse' ), 10, 3 );
}
}
}
/**
* @see init()
*/
public function __construct( $post_id )
{
$this->init( $post_id );
}
/**
* Callback for the "oembed_dataparse" hook, which will fire on a successful
* response from the oEmbed provider.
*
* @see WP_oEmbed::data2html()
*
* @param string $return The embed HTML
* @param object $data The oEmbed response
* @param string $url The oEmbed content URL
*/
public function oembed_dataparse( $return, $data, $url )
{
if ( ! empty( $data->thumbnail_url ) && ! $this->_thumb_id ) {
// if ( in_array( @ $data->type, array( 'video' ) ) ) // Only set for video embeds
$this->set_thumb_by_url( $data->thumbnail_url, @ $data->title );
}
}
/**
* Attempt to download the image from the URL, add it to the media library,
* and set as the featured image.
*
* @see media_sideload_image()
*
* @param string $url
* @param string $title Optionally set attachment title
*/
public function set_thumb_by_url( $url, $title = null )
{
/* Following assets will already be loaded if in admin */
require_once ABSPATH . 'wp-admin/includes/file.php';
require_once ABSPATH . 'wp-admin/includes/media.php';
require_once ABSPATH . 'wp-admin/includes/image.php';
$temp = download_url( $url );
if ( ! is_wp_error( $temp ) && $info = @ getimagesize( $temp ) ) {
if ( ! strlen( $title ) )
$title = null;
if ( ! $ext = image_type_to_extension( $info[2] ) )
$ext = '.jpg';
$data = array(
'name' => md5( $url ) . $ext,
'tmp_name' => $temp,
);
$id = media_handle_sideload( $data, $this->_post_id, $title );
if ( ! is_wp_error( $id ) )
return update_post_meta( $this->_post_id, '_thumbnail_id', $this->_thumb_id = $id );
}
if ( ! is_wp_error( $temp ) )
@ unlink( $temp );
}
}
A one man show is a cool thing. Especially when the one man behind the curtain is Tom Vek. This 80’s son pulls influences from a wide spectrum of musical spices, and like a maestro at the top of his game he knows when and where to sprinkle them. The song “You’ll Stay” is s far cry from Tom’s grunge garage music roots, but his ability to rock is still front and center. Peace. Continue reading “Tom Vek // You’ll Stay”
Jake Mattison pays homage to Gil Scott-Heron and his classic “Home Is Where The Hatred Is.” My hat off to Mr. Mattison for his soul stirring display of courage. Jake makes this rendition personal and it bleeds blood, leaving the scars of addiction open and utterly exposed like raw nerves doused with gasoline. This song is a heap of introspection too, and the weighty torment thick as the lies and flies out of a politicians mouth. Surviving addiction is to have rescued one’s dying self by taking the high, hard and lonely road to recovery. Jake has stripped the original track down to its bare bones. Denuded of accoutrement it is stark and beautifully lethargic. Mr. Mattison renders a tough gut-wrenching ode, and you get the feeling this is much more than just another song to be sung. I suspect this may be his torch song, his song of triumph and rebirth. This cover is the epitome of withdrawal, leaving a listener littered with moaning and the gnawing need for more. Jake, you are a survivor with the voice of a long neglected angel. Peace. Continue reading “Jake Mattison // Home Is Where The Hatred Is (Cover)”
The band Poliça just added additional tour dates for 2012 and I’m ever so thankful. I missed their show in Chicago and now I’ll be able see them here in Michigan! Poliça has got to be one of the sexiest bands in existence today. Yeah it’s the music, but without a doubt Channy Casselle-Leaneagh is a major ingredient to their appeal with her (she’ll hate for this ) pixieish good looks and seductive singing voice and style. A big thumbs up to one of most darling records in my collection. Peace. Continue reading “Poliça // Lay Your Cards Out (Video) + New Tour Dates”
It’s highly admirable aesthetics aside, the OP-1 Synthesiser is a musicians wet dream come true. Viewing it is tantamount to lusting after your favorite flesh and blood pin-up. But, like most things we use it is all about the performance, and this little gadget-that-could performs beautifully. Our Swedish brethren and sistren at Teenage Engineering are raising the bar heavenward with no end in sight. The OP-1 features eight synthesizer engines, a built-in 24 voice sampler, 4 track tape recorder, 4 track mixer with EQ, Effect, USB MIDI controller, and it’s Mac and PC compatible and this is just the shortlist. The OP-1 is a bit pricey, at just under 1K U.S. but so worth every single krona. For a complete rundown on what’s what you’ll have to visit www.teenageengineering.com. Peace.
Cold Specks is the project of Al Spx. Her voice is a mixture of southern gospel, the stark organic beauty of folk, with just a tinge of bluegrass at times. The songs she sings are eloquently performed hymnals; which touch your soul dead center. And when you hear words like haunting or ethereal as descriptors they’re on the mark. I first heard her offerings via the songs “Holland” and “Old Stepstone” both weighty and not for the faint of heart. Here, I posted the song, “Blank Maps” and after listening you can ‘hear’ why I’m a fan. You can pre-order her forthcoming debut LP I Predict A Graceful Expulsion (May 22nd) at www.coldspecks.com and at Amazon. Also, for further goosebump inducing fare, check out her cover of the Swans’ “Reeling The Liars In“, taken from the 12” Dancing Coins EP. Peace. Continue reading “cold specks // blank maps (our sunday best)”
The Other Guys kick it old school and that’s good enough for me. They take an old format and make it fresh again, imbuing each track with creativity and stellar production. I caught up the dynamic duo Mighty Joe and Gnormen Insanate Baites of TOG to talk about the new release Joe & Insanate’s Excellent LP. Continue reading “The Other Guys // Joe & Insanate’s Excellent LP”
You know I keeps it realer than real here and fresh to death. So, it’s only natural and not surprising that I bring you NumberNin6 and these just out the lab killa’ tracks. The Bad Medicine EP packs more bang than a roomful of t-n-t . This young gun Sir Nishant has stepped up to the plate and knocks it into the stratosphere . Yeah, you’ll want to crank this one extra loud, and if the neighbors come knockin’ just crack it louder! Also, you got to check out his webpage, where you’ll find hidden treasures galore at www.numbernin6.com. Peace. Continue reading “NumberNin6 // Bad Medicine EP”
DJ, producer, owner of the Deceast label the artist Deco is the consummate Jack of trades. But I’m more concerned with his knack for orchestrating sick beats with a penchant for the bass heavy and dapper dubstep. And really, I could go on and on but like always when it comes to music I like to let it just speak for itself. Peace. Continue reading “Deco // Thoughts Of The Past EP”
When you listen to Louisa Rose Allen bka Foxes it is easy to get lost in the abject beauty of her voice (hell, I’m still searching for the exit). With only a handful of single releases, like the beautiful track “Home” it makes me eager to hear what the rest of her Warrior EP will sound like. Oh well, I’ll just have to wait until July 5th to find out. Until then I just have to click repeat often. Peace. Continue reading “Foxes // Home”
If you’re in the mood for a jam band of the highest order then hang on tight to your knickers because Pond is the absolute real deal! I’ve discovered so many great Aussie bands recently, and I’m so pleased, hopefully you’ll be too. Pond exemplifies what it means to rock out with your cock out, so to speak. The bands super amazing track “You Broke My Cool” is akin to that dirty south super duo Outkast and their song, “Take Off Your Cool” featuring Nora Jones, think of it as it’s rockin third cousin once removed. and the song “Eye Pattern Blindness” is one hell of a wild romp through rock-funk-sub space! The band’s latest album is Beard, Wives, Denim and it’s a certified rock-n-roll monster. Both iTunes and Amazon, yeah they have it, and soon enough you will too! Peace. Continue reading “pond // you broke my cool (video)”