PPiShowtime 1.1.2

PPiShowtime 1.1.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Pedro Piñera.



  • By
  • Pedro Pinyera

PPiShowtime-Google-iOS-Library

Get showtimes from any City thanks to Google Showtime. I discovered there was no option to access to this information so I decided to parse the information directly from their Website. As iOS Developer I thought it would be useful to release a Objective-C class to get/parse this information for all developers. I called it PPiShowtime.

imageimage

Features

  • Blocks for sucessful and error process
  • Two sorting methods based on theaters or films
  • Three days information ( Today, Tomorrow, After tomorrow);
  • Find by City and, film or theater
  • Get URL to buy tickets for sessions

Requirements

In order to use PPiShowtime in your project you only have to add PPiShowtime folder into your project. It contains Hpple folder. Hpple is the XML/HTML parser for Objective-C we use to parse Google Showtime information and it depends on libxml2 so you need to add it into your project:

  • Add the libxml2.2.dylib framework to your project and search paths as described at Cocoa with Love
  • Import "PPiShowtime.h" where need to use it

Using

PPiShowtime has class methods to get the information needed. The easiest way to understand them is using an Example:

Getting theaters from a given City

[PPiShowtime getShowTimesOfCity:@"Valencia" 
                        shorter:PPiShowtimeShortingTheaters 
                        forDay:PPiShowtimeDateToday 
                        withSuccessfulHandler:^(NSArray *result) {} 
                        andErrorHandler:^(NSError *error) {}];         

Getting films from a given City

[PPiShowtime getShowTimesOfCity:@"Valencia" 
                        shorter:PPiShowtimeShortingFilms 
                        forDay:PPiShowtimeDateToday 
                        withSuccessfulHandler:^(NSArray *result) {} 
                        andErrorHandler:^(NSError *error) {}];         

Getting theaters for a given film and City

[PPiShowtime getSchedulesForFilm:@"r3sacon" 
                        inCity:@"Valencia" 
                        forDay:PPiShowtimeDateToday 
                        withSuccessfulHandler:^(NSDictionary *film) {}
                         andErrorHandler:^(NSError *error) {}];         

Getting films for a given theater and City

[PPiShowtime getFilmsForTheater:@"Lys" 
                        inCity:@"Valencia" 
                        forDay:PPiShowtimeDateToday 
                        withSuccessfulHandler:^(NSDictionary *film) {}
                         andErrorHandler:^(NSError *error) {}];         

Input data

The main in put parameters are PPiShowtimeDate and PPiShowtimeShorting because you can specify the day and organize the data by films or by theaters.

Date:

  • PPiShowtimeDateToday: Get showtimes of today
  • PPiShowtimeDateTomorrow: Get showtimes of tomorrow
  • PPiShowtimeDatePastTormorrow: Get showtimes of the day after tomorrow

Sorting:

  • PPiShowtimeDateFilms: Results sorted by films
  • PPiShowtimeDateTheaters: Results sorted by theaters

Output data

Output data from first two methods depend on sorting method. In case you organize it by movies the result has the following structure:

image

And in case movie sorting:

image

Film options

Each film title containts moreover information about the film ( if it's in 3D or in Digital for example ). PPiShowtime parse this information and include it in an extra array with OPTIONS

More info and support

If you like this library and you would like to contribute with it feel free to do it. I'll thank you. Moreover you'll find more information in my website www.ppinera.es and my portfolio as a developer.

License

MIT License