aon2003 / laravel-trustpilot
TrustPilot scraper for Laravel applications.
Requires
- php: ^8.1
- fabpot/goutte: ^4.0
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-10-10 00:02:15 UTC
README
This is a simple Laravel package for scraping TrustPilot scores and reviews.
Support us
Installation
You can install the package via composer:
composer require aon2003/laravel-trustpilot
You can publish the config file with:
php artisan vendor:publish --tag="trustpilot-config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | Default Domain |-------------------------------------------------------------------------- | | This is the domain for which the reviews will be scraped by default. | Supports subdomains. */ 'domain' => 'www.example.com', /* |-------------------------------------------------------------------------- | Default Language |-------------------------------------------------------------------------- | | This is the language in which the reviews will be scraped by default. | | Supported values: "all", ISO 639-1 language codes (ex.: "en", "ru") | */ 'language' => 'all', ];
Usage
$score = LaravelTrustpilot::getScore($domain); // float $reviews = LaravelTrustpilot::getReviews($domain, $language); // array<stdClass>
If you don't provide a domain and language the values from the config file will be used.
Commands
Additionally, there are two commands that can be used for testing purposes.
trustpilot:score
Description: Gets the TrustScore of a given domain and outputs it to the console. Usage: trustpilot:score [<domain>] Arguments: domain The domain for which to get the TrustScore.
trustpilot:reviews
Description: Gets the reviews of a given domain and outputs them to the console. Usage: trustpilot:reviews [<domain> [<language>]] Arguments: domain The domain for which to get the TrustPilot reviews. language The language in which to get the TrustPilot reviews.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
If you want to contribute, we would be pleased to see your pull requests.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.