Download the PHP package langleyfoxall/press-association-tv-api-wrapper without Composer
On this page you can find all versions of the php package langleyfoxall/press-association-tv-api-wrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download langleyfoxall/press-association-tv-api-wrapper
More information about langleyfoxall/press-association-tv-api-wrapper
Files in langleyfoxall/press-association-tv-api-wrapper
Package press-association-tv-api-wrapper
Short Description ?⌚️ Provides access to information regarding TV channels, schedules and schedule items
License LGPL-3.0-only
Informations about the package press-association-tv-api-wrapper
📺⌚️ Press Association TV API Wrapper
This package provides a client for the Press Association TV API.
It provides access to information regarding TV channels, schedules and schedule items.
The Press Association (PA) is the national news agency for the UK and Ireland and a leading multimedia content provider across web, mobile, broadcast and print. For the last 145 years PA has been providing fast, accurate feeds of text, data, photos and video. Today the business is increasingly focused on the delivery of complete products for both digital and print clients.
Installation
To install, just run the following Composer command from the root of your project.
Usage
First instantiate the client using your API key.
Channels
To retrieve details regarding a channel, call the getChannel
method, passing it a channel ID. If you wish to retrieve
details on multiple channels at once, you can call the getChannels
method instead, passing it an array of channel IDs.
These methods will, respectively, return a Channel
object or a collection of Channel
objects.
You may wish to surround this method call with a try catch block to catch any networking exceptions.
Example Channel
object
The example below shows the available public properties that are available with a Channel
object.
Schedules
You can retrieve the schedule for today by calling the getScheduleForToday
method, passing it an array of channel IDs.
Similarly, you can also retrieve the schedule for a specific day using the getScheduleForDay
method, passing it an
array of channel IDs and a Carbon
date object.
Both of these method will return a Schedule
object.
You may wish to surround this method call with a try catch block to catch any networking exceptions.
You can then retrieve all schedule items, by calling the Schedule
object's all
method.
Alternatively, you can retrieve schedule items filtered by genre, by calling the Schedule
object's getByGenre
method.
This method accepts a genre or sport name, such as Football
, Tennis
, or Boxing
.
Example ScheduleItem
object
The example below shows the available public properties that are available with a ScheduleItem
object.
Limitations
This library does not currently deal with API pagination. This should not be a problem, as channels do not tend to have over 1000 schedule items per day.
All versions of press-association-tv-api-wrapper with dependencies
illuminate/support Version ^5.1
cache/filesystem-adapter Version ^1.0
nesbot/carbon Version ^1.25