]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Script to test remote oEmbed endpoints
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 28 Sep 2015 10:25:40 +0000 (12:25 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 28 Sep 2015 10:25:40 +0000 (12:25 +0200)
plugins/Oembed/scripts/poll_oembed.php [new file with mode: 0755]

diff --git a/plugins/Oembed/scripts/poll_oembed.php b/plugins/Oembed/scripts/poll_oembed.php
new file mode 100755 (executable)
index 0000000..e49e1a5
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/env php
+<?php
+
+define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
+
+$shortoptions = 'u:';
+$longoptions = array('url=');
+
+$helptext = <<<END_OF_HELP
+poll_oembed.php --url URL
+Test oEmbed API on a URL.
+
+  -u --url  URL to try oEmbed against
+
+END_OF_HELP;
+
+require_once INSTALLDIR.'/scripts/commandline.inc';
+
+if (!have_option('u', 'url')) {
+    echo 'No URL given.';
+    exit(1);
+}
+
+$url = get_option_value('u', 'url');
+
+print "Contacting URL";
+
+$oEmbed = oEmbedHelper::getObject($url);
+var_dump($oEmbed);
+
+print "\nDONE.\n";