2017 © Pedro Peláez
 

library veezi-api-wrapper

A simple PHP website wrapper for the Veezi API.

image

simondavies/veezi-api-wrapper

A simple PHP website wrapper for the Veezi API.

  • Monday, June 5, 2017
  • by simondavies
  • Repository
  • 5 Watchers
  • 2 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Veezi-API-Wrapper

A basic PHP wrapper for the Veezi API., (*1)

THIS IS STILL IN DEVELOPEMENT AND CAN CHANGE, (*2)

While being asked to look into the Veezi API, to enable a website to display its relevant film data onto the site, so not to duplicate work etc. I would need to do a bit of work to manipulate the current data returned, to be used on a website, so not being able to find any current PHP code for use with the Veezi API, thought be nice to build this and thne make it available to Veezi as well as others., (*3)

Official Documentation

Offical documentation on the Veezi API can be found Veezi API, (*4)

Code Examples

Included within the repo is an examples folder, here you can find a few working examples of the various options., (*5)

Film Listings

Get and display a list of films Veezi Film Dates/Times listings, (*6)

//-- get the autoload page
require_once __DIR__ . '../../vendor/autoload.php';

//-- load in a some settings/configuration file.
require_once __DIR__ . '/config.php';

use VeeziAPI\VeeziAPIWrapper as VeeziAPI;
$Veezi = new VeeziAPI(VEEZI_API_TOKEN);

//--get a list of all films
$films = $Veezi->films();
//--loop throught the result and list by film title
foreach ($films as $film) {
    echo '<a href="film.php?filmid=' . $film->getId() . '">' . $film->getTitle() . '</a>';
}

Selected Film

//-- get the autoload page
require_once __DIR__ . '../../vendor/autoload.php';

//-- load in a some settings/configuration file.
require_once __DIR__ . '/config.php';

use VeeziAPI\VeeziAPIWrapper as VeeziAPI;
$Veezi = new VeeziAPI(VEEZI_API_TOKEN);

//--get a selected film
$film = $Veezi->selectedFilm($film_id);

//-- film title
$film_title = $film->getTitle();

//-- film synopsis
$film_synopsis = $film->getSynopsis();

//--film people Actor, Director, Producer
$film_people = $film->getPeople();

There are also other options available to a film instance, some more below. - $film->getGenre() - $film->getFormat() - $film->getLanguage() - $film->getDatesAndTimes() - $film->getRoles(), (*7)

There are also some that are returned as Arrays and other objects, take the $film->getStartDate(), what is returned is a Carbon instance, so it can be converted using any of the methods available through Carbon,, (*8)

//-- set date as a readable date
$film->getStartDate()->format('l jS \\of F Y');

Selected Film Poster

Currently it is NOT possible to gain access to the actual poster. As the posters are currently stored within the protected area of their severs, and in order gain access via a URL you will need to be signed in to the Veezi system., (*9)

So adding the url to the posters will fail for now. Veezi are looking into switchign this, so that they can also be referenced. in the mean time, in order to display posters, you will need to work on your own version/method., (*10)

If you need any ideas or solutions please feel free to contact me, on how i get around this., (*11)

Film Roles

Sort people and prepare a list of roles. (Actor/Director/Producer), (*12)

//-- return a list of roles and the people for each role 
$roles = $film->getRoles();



Actors

'; foreach ($roles['actors'] as $actors) { echo '
  • ' . $actors . '
  • ';} echo ''; ?>

    Directors

    '; foreach ($roles['directors'] as $directors) { echo '
  • ' . $directors . '
  • ';} echo ''; ?>

    Producers

    '; foreach ($roles['producers'] as $producers) { echo '
  • ' . $producers . '
  • ';} echo ''; ?>
    </div>

    The output would be somethig like:, (*13)

    Actors Directors Producers
    Actor Name Directors Name Producers Name

    List the selected films Dates and times, with booking links on the times., (*14)

    You can also get a list of dates and times for the selected film to display as clickable links to book tickets., (*15)

    Veezi Film Dates/Times listings, (*16)

    //-- Get the films dates and times
    $film_start_dates = $film->getDatesAndTimes();
    
    //-- Out put the Dates and times
    foreach ($film_start_dates as $date => $times) {
        echo '
    
    
    ' . $date . '
    '; echo '
    '; foreach ($times as $time) { echo '' . $time['time'] . ''; } echo '
    '; }

    Requiremnents

    Installation

    The recommended way to install this repo is through Composer, (*17)

    Install Through Composer

    If your using thsi as the initial project then you can install via:, (*18)

    composer create-project simondavies/veezi-api-wrapper
    

    Else to include within in a current project run, (*19)

    composer.phar require simondavies/veezi-api-wrapper
    

    Install Via Github/Without Composer

    Via SSH, (*20)

    git clone git@github.com:simondavies/Veezi-API-Wrapper.git target-directory
    

    Via HTTPS, (*21)

    git clone https://github.com/simondavies/Veezi-API-Wrapper.git target-directory
    

    Set Up

    Once the project has been downloaded we need to continue the initial set up., (*22)

    cd target-directory
    composer update
    

    Add a config file., (*23)

    cd App
    cp config.example.php config.php
    

    Update the following details with your Veezi API and Site Tokens., (*24)

    define('VEEZI_API_TOKEN', '?????????');
    define('VEEZI_SITE_TOKEN', '??????????');
    

    Once thats been done, you can check that all is OK by visiting the Examples folder within a Browser., (*25)

    Please view the other required repos' install guidelines, if not installing from composer., (*26)

    To Do

    As this is currently on going I have a list of to do's below:, (*27)

    • [x] Build the Film Classes
    • [ ] Build the Cinema classe(s)
    • [ ] Build the Screen classe(s)
    • [x] Add examples
    • [x] Create booking links for films
    • [x] Create film dates for each film
    • [ ] More in-depth read me file or wiki

    License

    The Veezi-API-Wrapper is open-sourced software licensed under the MIT license, (*28)

    The Versions

    05/06 2017

    dev-master

    9999999-dev

    A simple PHP website wrapper for the Veezi API.

      Sources   Download

    MIT

    The Requires

     

    api veezi film listing

    05/06 2017

    dev-develop

    dev-develop

    A simple PHP website wrapper for the Veezi API.

      Sources   Download

    MIT

    The Requires

     

    api veezi film listing

    17/11 2015

    0.1

    0.1.0.0

    A simple PHP website wrapper for the Veezi API.

      Sources   Download

    MIT

    The Requires

     

    api veezi film listing