-Depends on the oEmbed plugin (Oembed).
+Depends on the Embed plugin.
class BookmarkforurlAction extends Action
{
protected $url = null;
- protected $oembed = null;
+ protected $embed = null;
protected $thumbnail = null;
protected $title = null;
if ($f instanceof File) {
// FIXME: Use some File metadata Event instead
- $this->oembed = File_oembed::getKV('file_id', $f->id);
- if ($this->oembed instanceof File_oembed) {
- $this->title = $this->oembed->title;
+ $this->embed = File_embed::getKV('file_id', $f->id);
+ if ($this->embed instanceof File_embed) {
+ $this->title = $this->embed->title;
}
$this->thumbnail = File_thumbnail::getKV('file_id', $f->id);
}
* @copyright 2019 Free Software Foundation, Inc http://www.fsf.org
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
-class EmbedAction extends Action
+class OEmbedAction extends Action
{
protected function handle()
{
if (substr(strtolower($url), 0, mb_strlen($root_url)) !== strtolower($root_url)) {
// TRANS: Error message displaying attachments. %s is the site's base URL.
- throw new ClientException(sprintf(_('oEmbed data will only be provided for %s URLs.'), $root_url));
+ throw new ClientException(sprintf(_('Embed data will only be provided for %s URLs.'), $root_url));
}
$path = substr($url, strlen($root_url));
// maybe add thumbnail
foreach ($notice->attachments() as $attachment) {
if (!$attachment instanceof File) {
- common_debug('ATTACHMENTS array entry from notice id=='._ve($notice->getID()).' is something else than a File dataobject: '._ve($attachment));
+ common_debug('ATTACHMENTS array entry from notice id=='._ve($notice->getID()).
+ ' is something else than a File dataobject: '._ve($attachment));
continue;
}
try {
defined('GNUSOCIAL') || die();
/**
- * Utility class to wrap basic oEmbed lookups.
+ * Utility class to wrap basic embed lookups.
*
* Blacklisted hosts will use an alternate lookup method:
* - Twitpic
*
- * Whitelisted hosts will use known oEmbed API endpoints:
+ * Whitelisted hosts will use known embed API endpoints:
* - Flickr, YFrog
*
* Sites that provide discovery links will use them directly; a bug
* @copyright 2019 Free Software Foundation, Inc http://www.fsf.org
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
-class oEmbedHelper
+class EmbedHelper
{
protected static $apiMap = array(
'flickr.com' => 'https://www.flickr.com/services/oembed/',
if ($user && common_config('attachments', 'process_links')) {
$action->script($this->path('js/linkpreview.js'));
$data = json_encode(array(
- 'api' => common_local_url('oembedproxy'),
+ 'api' => common_local_url('embedproxy'),
'width' => common_config('attachments', 'thumbwidth'),
'height' => common_config('attachments', 'thumbheight'),
));
The LinkPreview plugin adds a UI for previewing thumbnails from links.
-Note: This plugin depends on the "Oembed" plugin.
+Note: This plugin depends on the "Embed" plugin.
Installation
============
Example
=======
-addPlugin('Oembed'); // Dependency
+addPlugin('Embed'); // Dependency
$config['attachments']['process_links'] = true;
$config['attachments']['thumbwidth'] = 42;
$config['attachments']['thumbheight'] = 42;
}
/**
- * Oembed proxy implementation
+ * Embed proxy implementation
*
* This class provides an interface for our JS-side code to pull info on
- * links from other sites, using either native oEmbed, our own custom
+ * links from other sites, using either native embed, our own custom
* handlers, or the noembed.com offsite proxy service as configured.
*
- * @category oEmbed
+ * @category embed
* @package StatusNet
* @author Brion Vibber <brion@status.net>
* @copyright 2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-class OembedproxyAction extends OembedAction
+class OEmbedproxyAction extends OEmbedAction
{
function handle()
{
// Trigger short error responses; not a human-readable web page.
GNUsocial::setApi(true);
- // We're not a general oEmbed proxy service; limit to valid sessions.
+ // We're not a general embed proxy service; limit to valid sessions.
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$params['maxheight'] = $this->arg('maxheight');
}
- $data = oEmbedHelper::getObject($url, $params);
+ $data = EmbedHelper::getObject($url, $params);
$this->init_document('json');
print json_encode($data);
{
const PLUGIN_VERSION = '2.0.0';
- // settings which can be set in config.php with addPlugin('Oembed', array('param'=>'value', ...));
+ // settings which can be set in config.php with addPlugin('Embed', array('param'=>'value', ...));
// WARNING, these are _regexps_ (slashes added later). Always escape your dots and end your strings
public $domain_whitelist = [
// hostname => service provider