]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Oembed/scripts/poll_oembed.php
Relatively experimental change to store thumbnails in 'file/thumb/' (by default)
[quix0rs-gnu-social.git] / plugins / Oembed / scripts / poll_oembed.php
1 #!/usr/bin/env php
2 <?php
3
4 define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
5
6 $shortoptions = 'u:';
7 $longoptions = array('url=');
8
9 $helptext = <<<END_OF_HELP
10 poll_oembed.php --url URL
11 Test oEmbed API on a URL.
12
13   -u --url  URL to try oEmbed against
14
15 END_OF_HELP;
16
17 require_once INSTALLDIR.'/scripts/commandline.inc';
18
19 if (!have_option('u', 'url')) {
20     echo 'No URL given.';
21     exit(1);
22 }
23
24 $url = get_option_value('u', 'url');
25
26 print "Contacting URL\n";
27
28 $oEmbed = oEmbedHelper::getObject($url);
29 var_dump($oEmbed);
30
31 print "\nDONE.\n";