shorten url :ps

This commit is contained in:
sanjeev 2021-12-01 18:28:20 +05:30
parent 4fd2154f3e
commit 2e3c14c306

View File

@ -11313,42 +11313,14 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
function getShortenURL_get(){
$url = $this->get('url');
$this->load->helper('video_grabber_helper');
// $url="https://venbainfotech.com/VenbaIT/";
// $result_data = "127.0.0.1:5000/sh_url?url=".$url;
// $result_data = exec($result_data);
// $result_data = json_decode($result_data,true);
$concat_url = "127.0.0.1:5000/sh_url?url=".$url;
$client = new \GuzzleHttp\Client();
// $response = $client->request('GET',$result_data);
// print_r($response);die();
// $ch = curl_init();
// $timeout = 5;
// curl_setopt($ch,CURLOPT_URL,$result_data);
// curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
// 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();
$res = $client->get($concat_url,['headers'=>['Content-Type' => 'application/json']]);
if($res && $res->getStatusCode() == 200)
{
$result_data = json_decode($response->getBody()->getContents());
}
print_r($result_data);die();
if(!empty($result_data) && $result_data['datastatus'] == 200)
{
$data['dataStatus'] = true;