From cfd4eb5361d8b110f355cf4e4884587929fa0ce9 Mon Sep 17 00:00:00 2001 From: Paul Kirby Date: Wed, 24 Oct 2018 13:49:46 -0500 Subject: [PATCH] Began work on the speech upload --- classes/LBRY_Speech.php | 4 +++- classes/LBRY_Speech_Parser.php | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/classes/LBRY_Speech.php b/classes/LBRY_Speech.php index f9ed354..91af569 100644 --- a/classes/LBRY_Speech.php +++ b/classes/LBRY_Speech.php @@ -36,7 +36,7 @@ class LBRY_Speech /** * Uploads assets to the speech server */ - public function upload_assets() + public function upload_assets($post_id) { $speech_url = get_option(LBRY_SETTINGS)[LBRY_SPEECH]; @@ -45,6 +45,8 @@ class LBRY_Speech return; } + + // TODO: Find assets, upload them to the Spee.ch Server } } diff --git a/classes/LBRY_Speech_Parser.php b/classes/LBRY_Speech_Parser.php index 44a3d1c..1ed2b1a 100644 --- a/classes/LBRY_Speech_Parser.php +++ b/classes/LBRY_Speech_Parser.php @@ -7,6 +7,17 @@ class LBRY_Speech_Parser { + + /** + * Relative url + * @param string $url a full url + * @return string protocol relative url + */ + protected function relative_url($url) + { + return substr($url, strpos($url, '//')); + } + public function rewrite($html) { // TODO: Completely fix this, as its super slow. Looking at cdn_enabler for ideas