An API that screenscrapes google.com/movies and returns cinemas and film listings based on a postcode search.
Simple Ruby on Rails application, using Mechanize and Nokogiri for screen grabbing and HTML parsing. Tested with RSpec.
- Clone the repo and install dependencies with
bundle
- Run with
rails s
and visithttp://localhost:3000/
API call for today's film showings for cinemas based on a postcode search. It will return JSON and there is no authentication.
Request
GET /api/v1/cinemas/search?postcode=:postcode
Response
{
"cinemas": [
{
"name": "Greenwich Picturehouse",
"address": "180 Greenwich High Road, London, United Kingdom",
"telephone": "0871 902 5732",
"movies": [
{
"title": "The Girl on the Train",
"length": "1hr 52min",
"rating": "15",
"showtimes": [
"13:20",
"15:50",
"18:20",
"20:50"
]
},
{
"title": "Bridget Jones's Baby",
"length": "2hr 2min",
"rating": "15",
"showtimes": [
"12:30",
"15:15",
"18:00"
]
},
{
"title": "Miss Peregrine's Home for Peculiar Children",
"length": "2hr 6min",
"rating": "12A",
"showtimes": [
"13:45",
"15:00",
"17:30"
]
}
]
}
]
}
This is work in progress. We hope to have the option to also return IMDB ratings and potentially other searches.