oembed.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCore UNA Core
  7. * @{
  8. */
  9. require_once('./inc/header.inc.php');
  10. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  11. $aLinks = bx_get('l');
  12. bx_import('BxDolEmbed');
  13. $oEmbed = BxDolEmbed::getObjectInstance('sys_system');
  14. /*
  15. echo bx_file_get_contents('https://publish.twitter.com/oembed?url=https://twitter.com/callmehouck/status/1780211820424569127', [], 'get', ['Accept: text/html'], $iHttpCode, [], 0, [CURLOPT_USERAGENT => false]);*/
  16. //, bx_get('theme')
  17. if (bx_get('html')){
  18. /* $a = bx_get_site_info($aLinks, array(
  19. 'thumbnailUrl' => array('tag' => 'link', 'content_attr' => 'href'),
  20. 'OGImage' => array('name_attr' => 'property', 'name' => 'og:image'),
  21. 'icon' => array('tag' => 'link', 'name_attr' => 'rel', 'name' => 'shortcut icon', 'content_attr' => 'href'),
  22. 'icon2' => array('tag' => 'link', 'name_attr' => 'rel', 'name' => 'icon', 'content_attr' => 'href'),
  23. 'icon3' => array('tag' => 'link', 'name_attr' => 'rel', 'name' => 'apple-touch-icon', 'content_attr' => 'href'),
  24. ));
  25. print_r( $a);*/
  26. echo '<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"" /><style>body, html {margin:0px} A{text-decoration:none; color:#222}</style><div style=" margin:0px auto; justify-content: center;" id="ifr">
  27. '.$oEmbed->getHtml($aLinks, '');
  28. exit();
  29. }
  30. echoJson($oEmbed->parseLinks($aLinks));