PHP code example of summerofhaze / hubtraffic-api

1. Go to this page and download the library: Download summerofhaze/hubtraffic-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

summerofhaze / hubtraffic-api example snippets


$api = new \HubtrafficApi\Api;
$video = $api->getVideoByUrl('http://www.pornhub.com/view_video.php?viewkey=ph57c67facc4ab2'); 

$api = new \HubtrafficApi\Api;
$details = $api->parseSourceAndId('http://www.pornhub.com/view_video.php?viewkey=ph57c67facc4ab2');
$video = $this->getVideo($details['source'], $details['id']);

$video; // some video
$api = new \HubtrafficApi\Api;
if (!$this->isVideoActive($video->source, $video->sourceId)) {
	// delete
}