PHP code example of rrortega / trustpilot-review-collector

1. Go to this page and download the library: Download rrortega/trustpilot-review-collector 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/ */

    

rrortega / trustpilot-review-collector example snippets


use RRO\Review\Collector\TrustpilotReviewCollector;

$businessUnitId="www.google.com";
$count=5;
$orderby = 'time';
$order = 'desc'
$trustpilot = new TrustpilotReviewCollector($businessUnitId,$count, $orderby , $order );
$reviews = $trustpilot->getReviews();

// The fetched reviews o  $r["body"];
     // echo  $r["rating"]; //1 to 5 float value
     // echo  $r["time"]; //ex: 2023-03-20T13:30:34.000Z
}

// The profile