oEmbed:
* OEmbed result will be ignored now, if containing error field. * Restored twitter oEmbed to API 1, as 1.1 *does* need OAuth. :(
This commit is contained in:
parent
c290734a01
commit
d0470b1201
|
@ -1,3 +1,8 @@
|
|||
Version 1.11 (brockhaus)
|
||||
-----------------------
|
||||
* OEmbed result will be ignored now, if containing error field.
|
||||
* Restored twitter oEmbed to API 1, as 1.1 *does* need OAuth. :(
|
||||
|
||||
Version 1.10 (brockhaus)
|
||||
-----------------------
|
||||
* Updated twitter oEmbed to API 1.1, what doesn't seem to need OAuth.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<provider>
|
||||
<name>Twitter Status</name>
|
||||
<url>https?://*.twitter.com/*/status(es)?/*</url>
|
||||
<endpoint>https://api.twitter.com/1.1/statuses/oembed.{format}</endpoint>
|
||||
<endpoint>https://api.twitter.com/1/statuses/oembed.{format}</endpoint>
|
||||
</provider>
|
||||
<provider>
|
||||
<url>http://*.vimeo.com/*</url>
|
||||
|
|
|
@ -30,7 +30,7 @@ class serendipity_event_oembed extends serendipity_event
|
|||
$propbag->add('description', PLUGIN_EVENT_OEMBED_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Grischa Brockhaus');
|
||||
$propbag->add('version', '1.10');
|
||||
$propbag->add('version', '1.11');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
|
@ -189,8 +189,14 @@ class serendipity_event_oembed extends serendipity_event
|
|||
$manager = ProviderManager::getInstance($maxwidth,$maxheight,$config);
|
||||
try {
|
||||
$obj=$manager->provide($url,"object");
|
||||
if (isset($obj)) {
|
||||
if (!empty($obj->error)) $obj=null;
|
||||
}
|
||||
if (!isset($obj)) {
|
||||
$obj = $this->expand_by_general_provider($url,$maxwidth,$maxheight);
|
||||
if (isset($obj)) {
|
||||
if (!empty($obj->error)) $obj=null;
|
||||
}
|
||||
}
|
||||
if (isset($obj)) {
|
||||
$obj = OEmbedDatabase::save_oembed($url,$obj);
|
||||
|
@ -222,7 +228,11 @@ class serendipity_event_oembed extends serendipity_event
|
|||
|
||||
if (isset($manager)) {
|
||||
try {
|
||||
return $manager->provide($url,'object');
|
||||
$obj = $manager->provide($url,'object');
|
||||
if (isset($obj)) {
|
||||
if (!empty($obj->error)) $obj=null;
|
||||
}
|
||||
return $obj;
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue