| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nice2/libraries/foundry/libraries/scraper/plugins/ |
Upload File : |
<?php
/**
* @package Foundry
* @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Foundry is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
class ScraperPluginOpengraph extends ScraperPlugin
{
public $patterns = [
// Example: <meta property="og:image" content="https://stackideas.com/images/easyblog_images/1257/b2ap3_thumbnail_easyblog-37-supports-joomla-3.jpg"/>
'image' => 'og:image',
// Example: <meta property="og:title" content="EasyBlog 3.7 is now Joomla 3.0 ready" />
'title' => 'og:title',
// Example: <meta property="og:description" content="EasyBlog 3.7 now works in Joomla 3.0 and comes with some new features." />
'desc' => 'og:description',
// Example: <meta property="og:type" content="article" />
'type' => 'og:type',
// Example: <meta property="og:type" content="article" />
'url' => 'og:url',
// Example: <meta property="og:video" content="http://www.youtube.com/v/T39GhB5uBGQ?version=3&autohide=1">
'video' => 'og:video',
// Example: <meta property="og:video:type" content="application/x-shockwave-flash">
'video_type' => 'og:video:type',
// Example: <meta property="og:video:width" content="640">
'video_width' => 'og:video:width',
// Example: <meta property="og:video:height" content="640">
'video_height' => 'og:video:height',
'video_duration' => 'og:video:duration'
];
public function process(&$result)
{
$opengraph = new stdClass();
foreach ($this->patterns as $key => $pattern) {
// Try to find the pattern now
$items = $this->parser->find('meta[property=' . $pattern . ']');
if (!$items) {
$items = $this->parser->find('meta[name=' . $pattern . ']');
}
foreach ($items as $meta) {
if ($key == 'title') {
// some title meta the html entities are wrong. e.g. &quot;Trailer&quot;
// most likely due to two time of htmlentities
// #3270
$meta->content = str_replace('&', '&', $meta->content);
}
$opengraph->$key = $meta->content;
break;
}
}
$result->opengraph = $opengraph;
}
}