qbnk / validoo-api-wrapper
Validoo PHP wrapper, based on spec in https://validoo.se/wp-content/uploads/2021/10/GS1_REST_TradeItemInformation_v2.0.pdf
v0.1.6
2022-08-31 12:04 UTC
Requires
- php: >=7.4
- ext-dom: *
- ext-json: *
- adbario/php-dot-notation: ^2.2
- guzzlehttp/guzzle: ^6.3 | ^7.0
Requires (Dev)
- mockery/mockery: ^1.3
- phpunit/phpunit: ^8.5
README
Scraping GS1 code tables
Code tables are available at https://gs1.se/en/guides/documentation/code-lists/
This seemed to work to scrape any of the code lists pages. Uncomment the "if sweden" whenever you want to scrape only swedish/all values (when that code list has the "only in sweden" column):
let codes = {};
jQuery('table.table-striped.responsive').find('td[data-th="Code value"]').map(function() {
const cell = jQuery(this),
name = cell.next(),
sweden = cell.next().next().next();
//if (sweden.find('span').text() === 'X') {
codes[cell.find('span').text().toLowerCase()] = name.find('span').text();
//}
});
JSON.stringify(codes);