shorten url :ps
This commit is contained in:
parent
4fd2154f3e
commit
2e3c14c306
@ -11313,42 +11313,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
|||||||
function getShortenURL_get(){
|
function getShortenURL_get(){
|
||||||
$url = $this->get('url');
|
$url = $this->get('url');
|
||||||
$this->load->helper('video_grabber_helper');
|
$this->load->helper('video_grabber_helper');
|
||||||
// $url="https://venbainfotech.com/VenbaIT/";
|
$concat_url = "127.0.0.1:5000/sh_url?url=".$url;
|
||||||
// $result_data = "127.0.0.1:5000/sh_url?url=".$url;
|
|
||||||
// $result_data = exec($result_data);
|
|
||||||
// $result_data = json_decode($result_data,true);
|
|
||||||
$client = new \GuzzleHttp\Client();
|
$client = new \GuzzleHttp\Client();
|
||||||
// $response = $client->request('GET',$result_data);
|
$res = $client->get($concat_url,['headers'=>['Content-Type' => 'application/json']]);
|
||||||
// print_r($response);die();
|
if($res && $res->getStatusCode() == 200)
|
||||||
// $ch = curl_init();
|
{
|
||||||
// $timeout = 5;
|
$result_data = json_decode($response->getBody()->getContents());
|
||||||
// curl_setopt($ch,CURLOPT_URL,$result_data);
|
}
|
||||||
// curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
|
print_r($result_data);die();
|
||||||
// curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
|
|
||||||
// $tinyurl = curl_exec($ch);
|
|
||||||
// print_r($tinyurl);die();
|
|
||||||
$client = new \GuzzleHttp\Client();
|
|
||||||
$res = $client->get( 'http://github.com', [
|
|
||||||
'headers' => ['Content-Type' => 'application/json'],
|
|
||||||
]);
|
|
||||||
print_r($res);
|
|
||||||
print_r(json_decode($res->getBody()));
|
|
||||||
// print_r($res);
|
|
||||||
// try{
|
|
||||||
// $response = $client->request('GET', 'http://github.com');
|
|
||||||
// print_r($response);die();
|
|
||||||
// }
|
|
||||||
// catch (ConnectException $e) {
|
|
||||||
// // Connection exceptions are not caught by RequestException
|
|
||||||
// echo "Internet, DNS, or other connection error\n";
|
|
||||||
// die;
|
|
||||||
// }
|
|
||||||
// catch (RequestException $e) {
|
|
||||||
// echo "Request Exception\n";
|
|
||||||
// die;
|
|
||||||
// }
|
|
||||||
|
|
||||||
die();
|
|
||||||
if(!empty($result_data) && $result_data['datastatus'] == 200)
|
if(!empty($result_data) && $result_data['datastatus'] == 200)
|
||||||
{
|
{
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user