SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Pick-a-Plex 
The Pinnacle Cinema 
Experience 
Chris Callahan & Randall Reed, Jr. 
Flatiron School Presents 
August 19th, 2014
The Problem 
● Too many 
theaters! 
● Too many 
showtimes! 
● Too much time to 
choose!
APIs 
“JSON is the lingua franca of the Internet”
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>' ); 
}); 
}});
Performance Enhancements 
● Raw SQL query to retrieve all data
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)
Performance Enhancements 
● Raw SQL query to retrieve all data 
● Rake tasks to delete old showtimes and call 
Rotten Tomatoes API
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
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
DEMO
Going Forward 
● More robust theater rating data 
● API caching 
● Additional movie info
Thank You 
@randallocalypse @_c_cal

Mais conteúdo relacionado

Mais procurados

Mais procurados (11)

Elixir at Evercam (By Milos Mosic)
Elixir at Evercam (By Milos Mosic)Elixir at Evercam (By Milos Mosic)
Elixir at Evercam (By Milos Mosic)
 
Lies, Damn Lies, and Benchmarks
Lies, Damn Lies, and BenchmarksLies, Damn Lies, and Benchmarks
Lies, Damn Lies, and Benchmarks
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfast
 
Fabric for fun_and_profit
Fabric for fun_and_profitFabric for fun_and_profit
Fabric for fun_and_profit
 
JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski
JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski
JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski
 
With a Mighty Hammer
With a Mighty HammerWith a Mighty Hammer
With a Mighty Hammer
 
Ansible, Simplicity, and the Zen of Python
Ansible, Simplicity, and the Zen of PythonAnsible, Simplicity, and the Zen of Python
Ansible, Simplicity, and the Zen of Python
 
Joomla! Day UK 2009 .htaccess
Joomla! Day UK 2009 .htaccessJoomla! Day UK 2009 .htaccess
Joomla! Day UK 2009 .htaccess
 
Serverless Ballerina
Serverless BallerinaServerless Ballerina
Serverless Ballerina
 
Deploying a Location-Aware Ember Application
Deploying a Location-Aware Ember ApplicationDeploying a Location-Aware Ember Application
Deploying a Location-Aware Ember Application
 

Destaque

RSA Fellowship Council Twitterstream 12-12-12
RSA Fellowship Council Twitterstream 12-12-12RSA Fellowship Council Twitterstream 12-12-12
RSA Fellowship Council Twitterstream 12-12-12
Roxanne Persaud
 
Let’s play sesame street! - Embrace the power of asking questions.
Let’s play sesame street! - Embrace the power of asking questions.Let’s play sesame street! - Embrace the power of asking questions.
Let’s play sesame street! - Embrace the power of asking questions.
☕ 🥧 🚲 Martin Gude
 
EuroITV: Predicting future User Behaviour in interactive live TV
EuroITV: Predicting future User Behaviour in interactive live TVEuroITV: Predicting future User Behaviour in interactive live TV
EuroITV: Predicting future User Behaviour in interactive live TV
☕ 🥧 🚲 Martin Gude
 
Paint a Picture – Who does your customer become when they use your product?
Paint a Picture – Who does your customer become when they use your product?Paint a Picture – Who does your customer become when they use your product?
Paint a Picture – Who does your customer become when they use your product?
☕ 🥧 🚲 Martin Gude
 

Destaque (20)

RSA Fellowship Council Twitterstream 12-12-12
RSA Fellowship Council Twitterstream 12-12-12RSA Fellowship Council Twitterstream 12-12-12
RSA Fellowship Council Twitterstream 12-12-12
 
Database Opt
Database Opt Database Opt
Database Opt
 
Brand Management For A Social Age
Brand Management For A Social AgeBrand Management For A Social Age
Brand Management For A Social Age
 
Into to Node.js: Building Fast, Scaleable Network Applications
Into to Node.js: Building Fast, Scaleable Network ApplicationsInto to Node.js: Building Fast, Scaleable Network Applications
Into to Node.js: Building Fast, Scaleable Network Applications
 
What's a Core Image? An Image-Processing Framework on iOS and OS X
What's a Core Image? An Image-Processing Framework on iOS and OS XWhat's a Core Image? An Image-Processing Framework on iOS and OS X
What's a Core Image? An Image-Processing Framework on iOS and OS X
 
Let’s play sesame street! - Embrace the power of asking questions.
Let’s play sesame street! - Embrace the power of asking questions.Let’s play sesame street! - Embrace the power of asking questions.
Let’s play sesame street! - Embrace the power of asking questions.
 
Formation marketing Québec - Analyse d'audience
Formation marketing Québec - Analyse d'audienceFormation marketing Québec - Analyse d'audience
Formation marketing Québec - Analyse d'audience
 
FOMO No Mo'
FOMO No Mo' FOMO No Mo'
FOMO No Mo'
 
Play Music...With Your Head: A Theremin App For Everyone
Play Music...With Your Head: A Theremin App For EveryonePlay Music...With Your Head: A Theremin App For Everyone
Play Music...With Your Head: A Theremin App For Everyone
 
Citi Bike Finder
Citi Bike FinderCiti Bike Finder
Citi Bike Finder
 
EuroITV: Predicting future User Behaviour in interactive live TV
EuroITV: Predicting future User Behaviour in interactive live TVEuroITV: Predicting future User Behaviour in interactive live TV
EuroITV: Predicting future User Behaviour in interactive live TV
 
Your social persona
Your social personaYour social persona
Your social persona
 
Paint a Picture – Who does your customer become when they use your product?
Paint a Picture – Who does your customer become when they use your product?Paint a Picture – Who does your customer become when they use your product?
Paint a Picture – Who does your customer become when they use your product?
 
Adplotter and Craigslist
Adplotter and CraigslistAdplotter and Craigslist
Adplotter and Craigslist
 
Design-muutosjohtaminen käytännössä
Design-muutosjohtaminen käytännössäDesign-muutosjohtaminen käytännössä
Design-muutosjohtaminen käytännössä
 
Starting With Strengths: The Stories We Build #edfling
Starting With Strengths: The Stories We Build #edflingStarting With Strengths: The Stories We Build #edfling
Starting With Strengths: The Stories We Build #edfling
 
Moving Beyond the Newsletter: Communicating Through Social Media
Moving Beyond the Newsletter: Communicating Through Social MediaMoving Beyond the Newsletter: Communicating Through Social Media
Moving Beyond the Newsletter: Communicating Through Social Media
 
Power of Outdoor Play - We Built a Hill
Power of Outdoor Play - We Built a HillPower of Outdoor Play - We Built a Hill
Power of Outdoor Play - We Built a Hill
 
Pigeons, Packs & Paid: Google Local 2015
Pigeons, Packs & Paid: Google Local 2015Pigeons, Packs & Paid: Google Local 2015
Pigeons, Packs & Paid: Google Local 2015
 
Start With Strengths - Canadian Association of Principals 2015
Start With Strengths - Canadian Association of Principals 2015Start With Strengths - Canadian Association of Principals 2015
Start With Strengths - Canadian Association of Principals 2015
 

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

#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 
Async. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.jsAsync. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.js
Shoaib Burq
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
Michelangelo van Dam
 

Semelhante a Pick-a-Plex App: The Pinnacle of Cinema Experiences (20)

Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Develop Netflix Movie Search App using jQuery, OData, JSONP and Netflix Techn...
Develop Netflix Movie Search App using jQuery, OData, JSONP and Netflix Techn...Develop Netflix Movie Search App using jQuery, OData, JSONP and Netflix Techn...
Develop Netflix Movie Search App using jQuery, OData, JSONP and Netflix Techn...
 
huhu
huhuhuhu
huhu
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire player
 
SQL 쿼리를 AWS DynamoDB에서 (CLI)로 사용해 볼까요?
SQL 쿼리를 AWS DynamoDB에서 (CLI)로 사용해 볼까요?SQL 쿼리를 AWS DynamoDB에서 (CLI)로 사용해 볼까요?
SQL 쿼리를 AWS DynamoDB에서 (CLI)로 사용해 볼까요?
 
ApacheCon 2005
ApacheCon 2005ApacheCon 2005
ApacheCon 2005
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected World
 
Postman On Steroids
Postman On SteroidsPostman On Steroids
Postman On Steroids
 
Beyond Page Level Metrics
Beyond Page Level MetricsBeyond Page Level Metrics
Beyond Page Level Metrics
 
Automation in angular js
Automation in angular jsAutomation in angular js
Automation in angular js
 
November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2
 
Service Workers for Performance
Service Workers for PerformanceService Workers for Performance
Service Workers for Performance
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Async. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.jsAsync. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.js
 
Make BDD great again
Make BDD great againMake BDD great again
Make BDD great again
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
 
How to Leverage APIs for SEO #TTTLive2019
How to Leverage APIs for SEO #TTTLive2019How to Leverage APIs for SEO #TTTLive2019
How to Leverage APIs for SEO #TTTLive2019
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
 
Curso de Node.js e MongoDB - 16
Curso de Node.js e MongoDB - 16Curso de Node.js e MongoDB - 16
Curso de Node.js e MongoDB - 16
 

Mais de Flatiron School

Mais de Flatiron School (7)

How to Leverage Your Network to Land Your First Job as a Developer
How to Leverage Your Network to Land Your First Job as a DeveloperHow to Leverage Your Network to Land Your First Job as a Developer
How to Leverage Your Network to Land Your First Job as a Developer
 
Pay and Get Paid: How To Integrate Stripe Into Your App
Pay and Get Paid: How To Integrate Stripe Into Your AppPay and Get Paid: How To Integrate Stripe Into Your App
Pay and Get Paid: How To Integrate Stripe Into Your App
 
Four Days Out: Quick Itineraries For Last-Minute Dates
Four Days Out: Quick Itineraries For Last-Minute DatesFour Days Out: Quick Itineraries For Last-Minute Dates
Four Days Out: Quick Itineraries For Last-Minute Dates
 
Intro to D3: Data-Driven Documents
Intro to D3: Data-Driven DocumentsIntro to D3: Data-Driven Documents
Intro to D3: Data-Driven Documents
 
JSON overview and demo
JSON overview and demoJSON overview and demo
JSON overview and demo
 
Creating Ruby Gems
Creating Ruby Gems Creating Ruby Gems
Creating Ruby Gems
 
Form Helpers
Form Helpers Form Helpers
Form Helpers
 

Último

Último (20)

Sourcing Success - How to Find a Clothing Manufacturer
Sourcing Success - How to Find a Clothing ManufacturerSourcing Success - How to Find a Clothing Manufacturer
Sourcing Success - How to Find a Clothing Manufacturer
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
What is an API Development- Definition, Types, Specifications, Documentation.pdf
What is an API Development- Definition, Types, Specifications, Documentation.pdfWhat is an API Development- Definition, Types, Specifications, Documentation.pdf
What is an API Development- Definition, Types, Specifications, Documentation.pdf
 
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
Reinforcement Learning – a Rewards Based Approach to Machine Learning - Marko...
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
Odoo vs Shopify: Why Odoo is Best for Ecommerce Website Builder in 2024
Odoo vs Shopify: Why Odoo is Best for Ecommerce Website Builder in 2024Odoo vs Shopify: Why Odoo is Best for Ecommerce Website Builder in 2024
Odoo vs Shopify: Why Odoo is Best for Ecommerce Website Builder in 2024
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 

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

  • 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.
  • 5. 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>' ); }); }});
  • 6. Performance Enhancements ● Raw SQL query to retrieve all data
  • 7. 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)
  • 8. Performance Enhancements ● Raw SQL query to retrieve all data ● Rake tasks to delete old showtimes and call Rotten Tomatoes API
  • 9.
  • 10. 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
  • 11. 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
  • 12. DEMO
  • 13. Going Forward ● More robust theater rating data ● API caching ● Additional movie info