From 81d7895f24420fbce6132d0c7cabe5a7488ac421 Mon Sep 17 00:00:00 2001 From: Harry Spink Date: Fri, 17 May 2019 10:43:29 +0100 Subject: [PATCH 1/2] Set the base URL to SSL - uClassify redirects... in a rather ungraceful way otherwise. --- uclassify.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uclassify.php b/uclassify.php index d408c77..0532e93 100644 --- a/uclassify.php +++ b/uclassify.php @@ -14,7 +14,7 @@ class uClassify { // private properties - private $baseUrl = 'http://uclassify.com/browse/'; + private $baseUrl = 'https://uclassify.com/browse/'; private $provider = "uClassify"; private $readkey = '***YOUR_READ_KEY***'; private $removeHTML = 1; @@ -147,4 +147,4 @@ public function classifyText($txt) { return $data; } } -?> \ No newline at end of file +?> From d9eaa950e0aff74809589c56d818856b9762c20c Mon Sep 17 00:00:00 2001 From: Harry Spink Date: Fri, 17 May 2019 10:43:55 +0100 Subject: [PATCH 2/2] should be $txt in the classifyText method --- uclassify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uclassify.php b/uclassify.php index 0532e93..d19047c 100644 --- a/uclassify.php +++ b/uclassify.php @@ -130,7 +130,7 @@ public function classifyUrl($url) { public function classifyText($txt) { // assemble the query string $qs = $this->baseUrl.$this->provider."/".ucwords($this->classifier).'/ClassifyText/?readkey='.urlencode($this->readkey). - '&text='.urlencode($url).'&removeHtml='.$this->removeHTML.'&output='.$this->encoding."&version=".$this->version; + '&text='.urlencode($txt).'&removeHtml='.$this->removeHTML.'&output='.$this->encoding."&version=".$this->version; // instantiate cUrl $curl = curl_init($qs);