https://github.com/firelike/itunes-api
Zend Framework module to consume iTunes APIs
https://github.com/firelike/itunes-api
guzzle-services guzzlehttp itunes-api zend-framework
Last synced: about 2 months ago
JSON representation
Zend Framework module to consume iTunes APIs
- Host: GitHub
- URL: https://github.com/firelike/itunes-api
- Owner: firelike
- License: bsd-3-clause
- Created: 2016-12-21T03:44:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-03T02:50:35.000Z (over 5 years ago)
- Last Synced: 2024-11-29T00:09:49.464Z (over 1 year ago)
- Topics: guzzle-services, guzzlehttp, itunes-api, zend-framework
- Language: PHP
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## iTunes API Client
[](https://travis-ci.org/firelike/itunes-api)
[](https://packagist.org/packages/firelike/itunes-api)
## Introduction
Laminas/Zend Framework module to consume iTunes API
## Installation
Install the module using Composer into your application's vendor directory. Add the following line to your
`composer.json`.
```json
{
"require": {
"firelike/itunes-api": "^1.0"
}
}
```
## Configuration
Enable the module in your `application.config.php` file.
```php
return array(
'modules' => array(
'Firelike\ITunes'
)
);
```
Copy and paste the `itunes.local.php.dist` file to your `config/autoload` folder and customize it with your credentials and
other configuration settings. Make sure to remove `.dist` from your file.Your `itunes.local.php` might look something like the following:
```php
[
'log'=>[
'enable'=>false,
'message_formats'=>[
'{method} {uri} HTTP/{version} {req_body}',
'RESPONSE: {code} - {res_body}',
],
'logger'=>[
'stream' => 'php://output',
]
]
]
];
```
## Usage
Calling from your code:
```php
use Firelike\ITunes\Request\AbstractRequest;
use Firelike\ITunes\Request\Search as SearchRequest;
use Firelike\ITunes\Service\ITunesService;
$request = new SearchRequest();
$request->setTerm('micheal connelly')
->setMedia('audiobook')
->setLimit(25);
$service = new ITunesService();
$result = $service->search($request);
$numberOfRecords = $result->toArray()['resultCount'];
var_dump($numberOfRecords);
$records= $result->toArray()['results'];
var_dump($records);
```
Using the console:
```php
php public/index.php itunes search -v
```
## Implemented Service Methods:
* **search**
* **lookup**
* **feed**
* **availableFeeds**
* **genres**
## Links
* [Zend Framework website](http://framework.zend.com)
* [iTunes Search API](https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/)
* [Apple RSS feeds](http://www.apple.com/rss/)
* [iTunes RSS Feed Generator](https://rss.itunes.apple.com/)