sergunik / google-shopping-category-parcer
Download Google Shopping Category, parse it and return as an array or 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: 2025-04-07 22:32:45 UTC
README
Google Shopping Category Parcer
Download Google Shopping Category, parse it and return as an array or json.
Installation
composer require sergunik/google-shopping-category-parcer
Usage
use GSCP\GSCPService; $service = new GSCPService(); $array = $service->toArray(); //or echo $service->toJson();
Or with parameters:
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();
Also you could setup parameters in constructor:
use GSCP\GSCPService; $service = new GSCPService([ 'locale' => 'uk_UA', 'filename' => 'storage/my-local-file.txt', 'columns' => ['id', 'name'] ]); $service->toArray();