rrortega/trustpilot-review-collector
最新稳定版本:v1.0.0
Composer 安装命令:
composer require rrortega/trustpilot-review-collector
包简介
TrustpilotReviewCollector is a PHP class designed to fetch and parse profile business data and reviews from Trustpilot.com
README 文档
README
Retrive data from Trustpilot.com TrustpilotReviewCollector is a PHP class designed to fetch and parse reviews and business profile from Trustpilot.com for a specified business unit ID. It supports pagination and allows customization of the number of reviews to fetch, sorting, and ordering. The class uses Symfony\DomCrawler and Symfony\HttpClient.
Installation
You can install TrustpilotReviewCollector library via Composer:
composer require rrortega/trustpilot-review-collector
Usage
Here's an example of how to use TrustpilotReviewCollector:
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 include details such as review ID, user, avatar, verified status, title, URL, content, rating, time,answer and answer_time. foreach($reviews as $r){ // echo $r["id"]; // echo $r["user"]; // echo $r["avatar"]; // echo $r["verified"]; //true if user is verified in truspilot // echo $r["iso"];//user country iso2 // echo $r["title"]; // echo $r["url"]; // echo $r["body"]; // echo $r["rating"]; //1 to 5 float value // echo $r["time"]; //ex: 2023-03-20T13:30:34.000Z } // The profile include details such as business, category, website, logo, rating, qualification, and total_reviews. $details= $trustpilot->getReviews(); // echo $details["business"]; // echo $details["category"]; // echo $details["website"]; // echo $details["logo"]; // echo $details["rating"]; // echo $details["qualification"]; // echo $details["total_reviews"];
Testing
You can run the unit tests for TrustpilotReviewCollector Library using PHPUnit:
./vendor/bin/phpunit
License
TrustpilotReviewCollector Library is licensed under the MIT license. See the LICENSE file for more information.
NO SEAS MALITO Y REGÁLAME UN CAFECITO 👉 https://ko-fi.com/rrortega
统计信息
- 总下载量: 2.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-22