sergunik / google-shopping-category-parcer
下载 Google Shopping Category,解析它并以数组或 JSON 格式返回
v1.1
2021-05-20 08:12 UTC
Requires
- php: ^7.2|^8.0
- ext-json: *
Requires (Dev)
- fakerphp/faker: ^1.9
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2024-09-07 21:19:38 UTC
README
Google Shopping Category Parcer
下载 Google Shopping Category,解析它并以数组或 JSON 格式返回。
安装
composer require sergunik/google-shopping-category-parcer
使用方法
use GSCP\GSCPService; $service = new GSCPService(); $array = $service->toArray(); //or echo $service->toJson();
或者使用参数
use GSCP\GSCPService; $service = new GSCPService(); $service->setLocale('uk_UA') //or other format uk-UA ->setFilename('storage/my-local-file.txt') //if you want to specify cache file ->setColumns([ //these columns by default 'id', 'name', 'parentId', 'parents', 'children', ]) ->toArray();
您还可以在构造函数中设置参数
use GSCP\GSCPService; $service = new GSCPService([ 'locale' => 'uk_UA', 'filename' => 'storage/my-local-file.txt', 'columns' => ['id', 'name'] ]); $service->toArray();