1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00
hubzilla_ynh/sources/addons/embedly/embedly.php

25 lines
No EOL
656 B
PHP

<?php
/**
* Name: Embedly
* Description: Use oohemebed.com to resolve oembeds that can't be discovered directly
* Version: 1.0
* Author: Mike Macgirvin <mike@zothub.com>
*
*/
function embedly_load() {
register_hook('oembed_probe','addon/embedly/embedly.php','embedly_oembed_probe');
}
function embedly_unload() {
unregister_hook('oembed_probe','addon/embedly/embedly.php','embedly_oembed_probe');
}
function embedly_oembed_probe($a,$b) {
// try oohembed service
$ourl = "http://oohembed.com/oohembed/?url=".$b['url'].'&maxwidth=' . $b['videowidth'];
$result = z_fetch_url($ourl);
if($result['success'])
$b['embed'] = $result['body'];
}