Pick-a-Plex App: The Pinnacle of Cinema Experiences
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Pick-a-Plex App: The Pinnacle of Cinema Experiences

on

  • 78 views

Web Development Students Randall Reed, Jr. and Chris Callahan presented their app, Pick-a-Plex, an app that uses SQL to help users pick a movie to go see.

Web Development Students Randall Reed, Jr. and Chris Callahan presented their app, Pick-a-Plex, an app that uses SQL to help users pick a movie to go see.

Statistics

Views

Total Views
78
Views on SlideShare
78
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Pick-a-Plex App: The Pinnacle of Cinema Experiences Presentation Transcript

  • 1. Pick-a-Plex The Pinnacle Cinema Experience Chris Callahan & Randall Reed, Jr. Flatiron School Presents August 19th, 2014
  • 2. The Problem ● Too many theaters! ● Too many showtimes! ● Too much time to choose!
  • 3. APIs “JSON is the lingua franca of the Internet”
  • 4. Integrating the YouTube API $( '.movie-title' ).on( 'click', function() { var title = $( this ).text().split( ' ' ).join( '+' ); var that = $( this ); if ( !$( this ).has( 'a' ).length ) { $.get( 'https://www.googleapis.com/youtube/v3/search?part=snippet' + '&order=rating&q=' + title + '+Official+Trailer&type=video' + '&videoDefinition=high&videoEmbeddable=true' + '&key=<%= ENV["YOUTUBE_API_KEY"] %>', function( data ) { var slug = data.items[0].id.videoId; that.append( '<br><a class="iframe" target="_blank"' + 'href="//www.youtube.com/embed/' + slug + '">Want to see the trailer?</a>' ); }); }});
  • 5. Performance Enhancements ● Raw SQL query to retrieve all data
  • 6. sql = <<-SQL SELECT theaters.name, theaters.id, theaters.rating, movies.title, movies.tomatometer, movies.description, showtimes.time, showtimes.fandango_url, showtimes.three_d FROM theaters JOIN ( SELECT showtimes.theater_id, movies.tomatometer FROM showtimes JOIN movies ON movies.id = showtimes.movie_id WHERE showtimes.theater_id = "#{self.id}" AND showtimes.time > "#{current_time}" GROUP BY showtimes.theater_id, movies.tomatometer ORDER BY movies.tomatometer DESC LIMIT 1 OFFSET 2 ) third_tomatometer ON theaters.id = third_tomatometer.theater_id JOIN showtimes ON showtimes.theater_id = theaters.id JOIN movies ON movies.tomatometer >= third_tomatometer.tomatometer AND movies.id = showtimes.movie_id WHERE showtimes.time > "#{current_time}" ORDER BY movies.tomatometer DESC, movies.title, showtimes.time SQL ActiveRecord::Base.connection.execute(sql)
  • 7. Performance Enhancements ● Raw SQL query to retrieve all data ● Rake tasks to delete old showtimes and call Rotten Tomatoes API
  • 8. Performance Enhancements ● Raw SQL query to retrieve all data ● Rake tasks to delete old showtimes and call Rotten Tomatoes API ● Check zip code before loading showtimes
  • 9. Zip Code Search class RequestsController < ApplicationController def create # ... matching_requests = Request.where("zip_code = ? AND created_at > ?", @request.zip_code, today) if matching_requests.empty? @request.save @request.make_theaters else @request = matching_requests.first end # ... end end
  • 10. DEMO
  • 11. Going Forward ● More robust theater rating data ● API caching ● Additional movie info
  • 12. Thank You @randallocalypse @_c_cal