From f7535ec89db619a06fb57157dccbf6b9940bd6b1 Mon Sep 17 00:00:00 2001 From: GrabzIt Date: Thu, 14 Oct 2021 16:53:15 +0100 Subject: [PATCH] Fix for web service path --- composer.json | 2 +- lib/GrabzItClient.php | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 551fc55..3804329 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "homepage": "https://grabz.it/", "description": "Use our API to allow your app to create images, DOCX documents, rendered HTML and PDF's from URL's or raw HTML. Additionally GrabzIt allows you to convert online videos into animated GIF's or HTML tables into CSV's.", "license": "MIT", - "version":"3.5.0", + "version":"3.5.2", "autoload": { "psr-4": { "GrabzIt\\": "lib/" diff --git a/lib/GrabzItClient.php b/lib/GrabzItClient.php index 4fe0c94..765171c 100644 --- a/lib/GrabzItClient.php +++ b/lib/GrabzItClient.php @@ -11,11 +11,11 @@ class GrabzItClient { const WebServicesBaseURL = "://api.grabz.it/services/"; - const TakePicture = "takepicture.ashx"; - const TakeTable = "taketable.ashx"; - const TakePDF = "takepdf.ashx"; - const TakeDOCX = "takedocx.ashx"; - const TakeHTML = "takehtml.ashx"; + const TakePicture = "takepicture"; + const TakeTable = "taketable"; + const TakePDF = "takepdf"; + const TakeDOCX = "takedocx"; + const TakeHTML = "takehtml"; const TrueString = "True"; private $applicationKey; @@ -166,7 +166,7 @@ public function URLToAnimation($url, GrabzItAnimationOptions $options = null) $options = new GrabzItAnimationOptions(); } - $this->request = new GrabzItRequest($this->getRootUrl() . "takeanimation.ashx", false, $options, $url); + $this->request = new GrabzItRequest($this->getRootUrl() . "takeanimation", false, $options, $url); } /* @@ -521,7 +521,7 @@ public function GetStatus($id) return null; } - $result = $this->Get($this->getRootUrl() . "getstatus.ashx?id=" . $id); + $result = $this->Get($this->getRootUrl() . "getstatus?id=" . $id); $obj = simplexml_load_string($result); @@ -548,7 +548,7 @@ public function GetResult($id) return null; } - $result = $this->Get($this->getRootUrl() . "getfile.ashx?id=" . $id); + $result = $this->Get($this->getRootUrl() . "getfile?id=" . $id); if (empty($result)) { @@ -571,7 +571,7 @@ public function GetCookies($domain) $qs = "key=" .urlencode($this->applicationKey)."&domain=".urlencode($domain)."&sig=".$sig; - $obj = $this->getResultObject($this->Get($this->getRootUrl() . "getcookies.ashx?" . $qs)); + $obj = $this->getResultObject($this->Get($this->getRootUrl() . "getcookies?" . $qs)); $result = array(); @@ -613,7 +613,7 @@ public function SetCookie($name, $domain, $value = "", $path = "/", $httponly = $qs = "key=" .urlencode($this->applicationKey)."&domain=".urlencode($domain)."&name=".urlencode($name)."&value=".urlencode($value)."&path=".urlencode($path)."&httponly=".intval($httponly)."&expires=".urlencode($expires)."&sig=".$sig; - return $this->isSuccessful($this->Get($this->getRootUrl() . "setcookie.ashx?" . $qs)); + return $this->isSuccessful($this->Get($this->getRootUrl() . "setcookie?" . $qs)); } /* @@ -630,7 +630,7 @@ public function DeleteCookie($name, $domain) $qs = "key=" .urlencode($this->applicationKey)."&domain=".urlencode($domain)."&name=".urlencode($name)."&delete=1&sig=".$sig; - return $this->isSuccessful($this->Get($this->getRootUrl() . "setcookie.ashx?" . $qs)); + return $this->isSuccessful($this->Get($this->getRootUrl() . "setcookie?" . $qs)); } /* @@ -692,7 +692,7 @@ public function AddWaterMark($identifier, $path, $xpos, $ypos) $context = stream_context_create($opts); - $response = @file_get_contents($this->getRootUrl() . 'addwatermark.ashx', false, $context); + $response = @file_get_contents($this->getRootUrl() . 'addwatermark', false, $context); if (isset($http_response_header)) { @@ -720,7 +720,7 @@ public function DeleteWaterMark($identifier) $qs = "key=" .urlencode($this->applicationKey)."&identifier=".urlencode($identifier)."&sig=".$sig; - return $this->isSuccessful($this->Get($this->getRootUrl() . "deletewatermark.ashx?" . $qs)); + return $this->isSuccessful($this->Get($this->getRootUrl() . "deletewatermark?" . $qs)); } /* @@ -758,7 +758,7 @@ private function _getWaterMarks($identifier = null) $qs = "key=" .urlencode($this->applicationKey)."&identifier=".urlencode($identifier)."&sig=".$sig; - $obj = $this->getResultObject($this->Get($this->getRootUrl() . "getwatermarks.ashx?" . $qs)); + $obj = $this->getResultObject($this->Get($this->getRootUrl() . "getwatermarks?" . $qs)); $result = array();