2017 © Pedro Peláez
 

library guzzle-markus-client

Guzzle client for Markus API e.g. http://forumcinemas.lv/XML.

image

devmachine/guzzle-markus-client

Guzzle client for Markus API e.g. http://forumcinemas.lv/XML.

  • Wednesday, September 9, 2015
  • by lakiboy
  • Repository
  • 4 Watchers
  • 4 Stars
  • 322 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Guzzle Client for MCS API

Build Status, (*1)

SensioLabsInsight, (*2)

Scrutinizer Code Quality, (*3)

Guzzle client for Markus Cinema System installations - http://www.markus.ee/. Used in Baltics, Finland, Iceland and Malta. In Latvia, Lithuania and Estonia best known as ForumCinemas chain., (*4)

Cinemas list (not complete):

  • http://www.forumcinemas.lv/XML
  • http://www.forumcinemas.lt/XML
  • http://www.forumcinemas.ee/XML
  • http://www.finnkino.fi/XML
  • http://www.sambio.is/XML
  • http://www.edencinemas.com.mt/XML (incomplete and untested)
  • http://www.cinamonkino.lv/XML (Riga)
  • http://www.multikino.lv/XML (Riga)

There are more MCS installations (e.g. http://www.silverscreen.lv), but not all of them have a public XML API. If you happen to know any working XML URLs - create a pull request., (*5)

Description

This guzzle client tries to fix various inconsistencies of XML API, regroup, rename and filter returned results. Basically to make it look like you deal with fine-tuned JSON API., (*6)

Installation

This library can be installed using Composer. Add the following to your composer.json:, (*7)

{
    "require": {
        "devmachine/guzzle-markus-client": "1.0.*"
    }
}

Terminology

Some terminology explained used in MCS API:, (*8)

  • area - represents a location of theatres (usually a city),
  • event - represents a movie,
  • show - represents a show time of a movie i.e. theatre, auditorium, movie (event) and date/time of the show.

Sample usage

use Devmachine\Guzzle\Markus\MarkusClient;

$client = MarkusClient::factory('http://forumcinemas.ee/xml');
$result = $client->areas();

var_dump($result['items']);

Sample output:, (*9)

array(4) {
  [0] =>
  array(2) {
    'id' =>
    string(4) "1002"
    'name' =>
    string(21) "Tallinn - kõik kinod"
  }
  [1] =>
  array(2) {
    'id' =>
    string(4) "1008"
    'name' =>
    string(15) "Coca-Cola Plaza"
  }
  [2] =>
  array(2) {
    'id' =>
    string(4) "1005"
    'name' =>
    string(19) "Tartu - Kino Ekraan"
  }
  [3] =>
  array(2) {
    'id' =>
    string(4) "1004"
    'name' =>
    string(18) "Narva - Kino Astri"
  }
}

API methods

There are no required parameters. Below there is an example with all possible arguments for each method., (*10)

use Devmachine\Guzzle\Markus\MarkusClient;

$client = MarkusClient::factory('http://forumcinemas.ee/xml');

// Get list of locations.
$result = $client->areas();

// Get list of languages.
$result = $client->languages();

// Get list of show dates.
$result = $client->schedule([
    'area' => $areaId // Defaults to first area in the list.
]);

// Get list of article categories.
$result = $client->articleCategories([
    'area' => $areaId // Filter by area.
]);

// Get list of articles.
$result = $client->articles([
    'area'     => $areaId,    // Filter by area.
    'event'    => $eventId,   // When specified "category" parameter has no effect.
    'category' => $categoryId // Filter by category.
]);

// Get list of events.
$result = $client->events([
    'area'            => $areaId,  // Has no effect when "coming_soon" parameter is set to true.
    'id'              => $eventId, // When specified "area" and "coming_soon" parameters have no effect.
    'include_videos'  => true,     // Include video data. Defaults to false.
    'include_links'   => true,     // Include links data. Defaults to false.
    'include_gallery' => true,     // Include gallery data. Defaults to false.
    'all_images'      => true,     // Fetch all available images (except gallery). Defaults to false.
    'coming_soon'     => true      // Show upcoming events. Defaults to false.
]);

// Get list of shows.
$result = $client->shows([
    'area'           => $areaId,      // Defaults to first area in the list.
    'event'          => $eventId,     // Filter by event.
    'date'           => '2014-04-28', // Defaults to today.
    'days_from_date' => 2,            // Amount of days to include from date. Defaults to 1.
]);

Image formats

Accoding to findings MCS API has consistent images naming/dimensions., (*11)

Name Portrait Landscape
micro 59x87 88x31
small 99x146 148x100
medium 320x480 310x150
large 480x711 670x250
xlarge 640x948 851x315
hd 720x1280 1280x720
full hd 1080x1920 1920x1080
poster 768x1097 -

The Versions

09/09 2015

dev-master

9999999-dev http://devmachine.net

Guzzle client for Markus API e.g. http://forumcinemas.lv/XML.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitri Lakachauskis

api guzzle markus forumcinemas

09/09 2015

1.1.0

1.1.0.0 http://devmachine.net

Guzzle client for Markus API e.g. http://forumcinemas.lv/XML.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitri Lakachauskis

api guzzle markus forumcinemas

30/03 2015

1.0.3

1.0.3.0 http://devmachine.net

Guzzle client for Markus API e.g. http://forumcinemas.lv/XML.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitri Lakachauskis

api guzzle markus forumcinemas

13/03 2015

1.0.2

1.0.2.0 http://devmachine.net

Guzzle client for Markus API e.g. http://forumcinemas.lv/XML.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitri Lakachauskis

api guzzle markus forumcinemas

13/03 2015

1.0.1

1.0.1.0 http://devmachine.net

Guzzle client for Markus API e.g. http://forumcinemas.lv/XML.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitri Lakachauskis

api guzzle markus forumcinemas

28/04 2014

1.0.0

1.0.0.0 http://devmachine.net

Guzzle client for Markus API e.g. http://forumcinemas.lv/XML.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitri Lakachauskis

api guzzle markus forumcinemas