aon2003 / laravel-trustpilot
Laravel 应用程序的 TrustPilot 爬虫。
1.0.0
2023-01-27 19:46 UTC
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-09-09 23:46:14 UTC
README
这是一个简单的 Laravel 扩展包,用于抓取 TrustPilot 的评分和评论。
支持我们
安装
您可以通过 composer 安装此包
composer require aon2003/laravel-trustpilot
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="trustpilot-config"
这是发布配置文件的内容
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', ];
使用方法
$score = LaravelTrustpilot::getScore($domain); // float $reviews = LaravelTrustpilot::getReviews($domain, $language); // array<stdClass>
如果您没有提供域名和语言,将使用配置文件中的值。
命令
此外,还有两个命令可用于测试目的。
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.
变更日志
有关最近更改的更多信息,请参阅 变更日志
贡献
如果您想做出贡献,我们非常欢迎您的 pull request。
安全漏洞
请查看 我们的安全策略 了解如何报告安全漏洞。
致谢
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件