Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haringsrob/icecat
A php class to communicate with the icecat product database
https://github.com/haringsrob/icecat
Last synced: 8 days ago
JSON representation
A php class to communicate with the icecat product database
- Host: GitHub
- URL: https://github.com/haringsrob/icecat
- Owner: haringsrob
- Created: 2016-02-16T18:05:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-10-07T10:38:58.000Z (about 3 years ago)
- Last Synced: 2024-10-05T14:17:14.528Z (about 1 month ago)
- Language: PHP
- Size: 94.7 KB
- Stars: 18
- Watchers: 8
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Icecat
======
[![Build Status](https://travis-ci.org/haringsrob/icecat.svg?branch=master)](https://travis-ci.org/haringsrob/icecat)
[![Code Climate](https://codeclimate.com/github/haringsrob/icecat/badges/gpa.svg)](https://codeclimate.com/github/haringsrob/icecat)Icecat is a PHP library, that assists you in the following 2 procedures:
* Fetching data from the Icecat database using basic product information.
* Parsing this data from the Icecat response, and using them in real life applications.### About Icecat
[Icecat](http://icecat.biz, "Icecat") is an open catalog, providing free access to thousands of product datasheets.
In extend, when taking a subscription, the amount of accessible datasheets are increased.There is a list of [Icecat sponsor brands](http://icecat.co.uk/en/menu/partners/index.html, "Icecat sponsor brands").
Installation
============The library can be installed using composer:
```
"haringsrob/icecat": "dev-master"
```Usage
=====The class library is, in it's current state easy to be used.
### Result
The [Icecat class](https://github.com/haringsrob/icecat/blob/master/src/Model/Icecat.php) is responsible for parsing the data. It includes a few basic methods, but you can easily create your
own implementation by implementing the IcecatInterface interface.```php
// Use the class.
use haringsrob\Icecat\Model\Result;// See IcecatFetcher on how to get data or implement your own way.
$data = $fetcher->getBaseData();// Initialize.
$icecat = new Result($data);// Brand name. e.g.: Acer
$icecat->getSupplier();// Long description of the product.
$icecat->getLongDescription();// Short description.
$icecat->getShortDescription();// The category the product belongs to. e.g.: Notebooks
$icecat->getCategory();// Returns maximum 5 images about the product (optional limit).
$icecat->getImages(5);// Returns key => value array with specifications. e.g: ['cpu' => 'Core I5', 'screensize' => '15.6']
$icecat->getSpecs();// Returns array with videos of the product.
$icecat->getVideos();// Returns array with manuals.
$icecat->getManuals();// Returns array with 360 images.
$icecat->get360imageArray();// Returns array with Reasons to Buy.
$icecat->getReasonsToBuy();```
Demo is soon available.
### Fetcher
The [IcecatFetcher](https://github.com/haringsrob/icecat/blob/master/src/Model/IcecatFetcher.php) is responsible for fetching the data from the database.
```php
// Use the class.
use haringsrob\Icecat\Model\Fetcher;// Inititialize.
$fetcher = new Fetcher(
'Username',
'Password',
'Ean',
'Language'
);// Fetch the actual data.
$data = $fetcher->fetchBaseData();
```Integrations
============[Drupal module](https://www.drupal.org/project/icecat "Icecat Drupal") under active development.