poll_oembed.php 550 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env php
  2. <?php
  3. define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
  4. $shortoptions = 'u:';
  5. $longoptions = array('url=');
  6. $helptext = <<<END_OF_HELP
  7. poll_oembed.php --url URL
  8. Test oEmbed API on a URL.
  9. -u --url URL to try oEmbed against
  10. END_OF_HELP;
  11. require_once INSTALLDIR.'/scripts/commandline.inc';
  12. if (!have_option('u', 'url')) {
  13. echo 'No URL given.';
  14. exit(1);
  15. }
  16. $url = get_option_value('u', 'url');
  17. print "Contacting URL\n";
  18. $oEmbed = oEmbedHelper::getObject($url);
  19. var_dump($oEmbed);
  20. print "\nDONE.\n";