SlideShare a Scribd company logo
Shazam to Spotify
web demo project
Converting a Shazam history in a Spotify playlist.

Fabio Mora - http://fabio.mora.name
Live at http://shazam2spotify.techeffe.net
Source at https://github.com/morafabio/shazam2spotify/
Try it by downloading a sample Shazam history.

Fabio Mora - http://fabio.mora.name
Fabio Mora - http://fabio.mora.name
Technologies
● Frontend
○ Twitter Bootstrap 3
○ AngularJS

● Backend
○ PHP5.4
○ Silex - a web microframework based on Symfony2
○ Guzzle - a HTTP client for consuming web services

● Server
○
○
○
○

A small cloud VPS
Ubuntu 12.04
nginx
php-fpm
Fabio Mora - http://fabio.mora.name
Coding notes
● C.R.C. cards
○ I started with those to clarify myself the domain model

● T.D.D.
○ I used Test Driven Development
■
■

Karma is used for JS unit testing
PHPUnit is used for unit and integration tests

● Covered by end to end tests
○ Selenium is used for functional tests

● Continuous Integration
○ Travis CI is used as CI server
https://travis-ci.org/morafabio/shazam2spotify

Fabio Mora - http://fabio.mora.name
Coding notes
● Git as version control system
○ And hosted on GitHub
https://github.com/morafabio/shazam2spotify/

● Bash scripting
○ Repetitive tasks and builds are automated
https://github.com/morafabio/shazam2spotify/tree/master/scripts

● Dependency managers
○ Composer for PHP
○ Bower for JS
○ NPM for Karma

● Design Patterns
○ Factory, Proxy, Mediator, Decorator (from the GoF)
○ Dependency Injection
○ MVC
Fabio Mora - http://fabio.mora.name
How it works
1. A file is uploaded to the server service via POST
●

https://github.com/morafabio/shazam2spotify/blob/master/public/js/app.js#L9-L24

2. The controller handle the request
●

https://github.com/morafabio/shazam2spotify/blob/master/public/service/app.php#L20-L41

3. The parser filters the input file
●

https://github.com/morafabio/shazam2spotify/blob/master/src/Shazam2Spotify/Shazam/History.php#L27-L39

4. Domain object are generated: playlist and songs
●

https://github.com/morafabio/shazam2spotify/tree/master/src/Shazam2Spotify/Common

5. Each song in the playlist is parsed
●

https://github.com/morafabio/shazam2spotify/blob/master/src/Shazam2Spotify/Service/Locator.php#L24-L33

6. The Spotify Metadata API is consumed
●

https://github.com/morafabio/shazam2spotify/blob/master/src/Shazam2Spotify/Spotify/Metadata.php

7. The response is sent back in JSON
●

https://github.com/morafabio/shazam2spotify/blob/master/src/Shazam2Spotify/Common/Playlist.php#L24-L33

8. The view is rendered by the controller
●
●

https://github.com/morafabio/shazam2spotify/blob/master/public/js/filters.js
https://github.com/morafabio/shazam2spotify/blob/master/public/index.html#L66-L83
Fabio Mora - http://fabio.mora.name
Thanks!

Fabio Mora - http://fabio.mora.name

More Related Content

PDF
Useful Vim Plugins
PDF
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
ODP
HTML5 on Linux Desktop
ODP
GNOME on Android Dongle
PDF
Pharo 7.0 and 8.0 alpha
PDF
Screaming Architecture with Symfony
PDF
Skyfall b sides-c00-l-ed5-sp-2013
PDF
grifork - fast propagative task runner -
Useful Vim Plugins
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
HTML5 on Linux Desktop
GNOME on Android Dongle
Pharo 7.0 and 8.0 alpha
Screaming Architecture with Symfony
Skyfall b sides-c00-l-ed5-sp-2013
grifork - fast propagative task runner -

What's hot (11)

PDF
"fireap" - fast task runner on consul
PDF
Python in a real life
PDF
Pharo 8.0 (alpha) and more
PPTX
Raspberry pi Part 26
PPTX
Front Page of Hacker News with GitLab Pages
PDF
Mothra - A FreeBSD send-pr tool for bugzilla system
KEY
Heroku & Sinatra
PDF
KDE Plasma Develop Intro
PPTX
Type script新鮮貨報你知
PDF
Embedding Chromium into AGL demo platform with WAM
PDF
Having fun with Raspberry(s) and Apache projects
"fireap" - fast task runner on consul
Python in a real life
Pharo 8.0 (alpha) and more
Raspberry pi Part 26
Front Page of Hacker News with GitLab Pages
Mothra - A FreeBSD send-pr tool for bugzilla system
Heroku & Sinatra
KDE Plasma Develop Intro
Type script新鮮貨報你知
Embedding Chromium into AGL demo platform with WAM
Having fun with Raspberry(s) and Apache projects
Ad

Similar to Shazam to Spotify - spike/demo web project (20)

PDF
Deployment tales
PDF
Deployment tales
PDF
Fuzzing softwares for bugs - OWASP Seasides
PDF
Magento 2 performance profiling and best practices
PDF
TYPO3 Flow - Web Sockets
PDF
使用Eclipse快樂的mruby開發
PDF
CloudOpen North America 2013: Vagrant & CFEngine
PDF
Bodin - Hullin & Potencier - Magento Performance Profiling and Best Practices
PDF
Panther loves Symfony apps
PPTX
SaaS Boilerplate.pptx
PDF
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
PDF
Mitmproxy usage v20141216
PDF
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
PDF
Using VIM for PHP/Symfony development
PDF
TriplePlay-WebAppPenTestingTools
PDF
Argocd up and running
PDF
Scalable Django Architecture
ODP
Running Symfony
PDF
Android Platform Debugging and Development
PDF
Chef on SmartOS
Deployment tales
Deployment tales
Fuzzing softwares for bugs - OWASP Seasides
Magento 2 performance profiling and best practices
TYPO3 Flow - Web Sockets
使用Eclipse快樂的mruby開發
CloudOpen North America 2013: Vagrant & CFEngine
Bodin - Hullin & Potencier - Magento Performance Profiling and Best Practices
Panther loves Symfony apps
SaaS Boilerplate.pptx
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
Mitmproxy usage v20141216
ENIB 2015 2016 - CAI Web S02E03- Forge JS 1/4 - La forge JavaScript
Using VIM for PHP/Symfony development
TriplePlay-WebAppPenTestingTools
Argocd up and running
Scalable Django Architecture
Running Symfony
Android Platform Debugging and Development
Chef on SmartOS
Ad

More from Fabio Mora (20)

PDF
Esperimenti Kanban: tra economia e teoria delle code.
PDF
La Unix Way vista da un DevOps
PDF
We don't talk about Agile anymore
PDF
A quick introduction: Extreme Programming
PDF
Quick Introduction: Extreme Programming
PDF
Progressive Feature Rollout
PDF
It was just Open Source - TEDx Novara
PDF
2009 - Quotidiana Legalità
PDF
The Crossword Game
PDF
Continuous Delivery di una WebApp - by example
PDF
L’elefante nella stanza! [con LiquidO™] - Codemotion 2014
PDF
L’elefante nella stanza! [con LiquidO™]
PDF
Tanti "piccoli rilasci" con Symfony2
PDF
LinuxDay 2009 - Quali programmi?
PDF
LinuxDay 2009 - Cos'è Linux?
PDF
Se “Embrace Change” è difficile.
PDF
If "Embrace Change" is Hard (@milano-xpug)
PDF
Perchè Agile? Cambiamenti culturali work in progress.
PDF
cambiare punto di vista
PDF
CoderDojo - Galliate, 20 aprile 2013
Esperimenti Kanban: tra economia e teoria delle code.
La Unix Way vista da un DevOps
We don't talk about Agile anymore
A quick introduction: Extreme Programming
Quick Introduction: Extreme Programming
Progressive Feature Rollout
It was just Open Source - TEDx Novara
2009 - Quotidiana Legalità
The Crossword Game
Continuous Delivery di una WebApp - by example
L’elefante nella stanza! [con LiquidO™] - Codemotion 2014
L’elefante nella stanza! [con LiquidO™]
Tanti "piccoli rilasci" con Symfony2
LinuxDay 2009 - Quali programmi?
LinuxDay 2009 - Cos'è Linux?
Se “Embrace Change” è difficile.
If "Embrace Change" is Hard (@milano-xpug)
Perchè Agile? Cambiamenti culturali work in progress.
cambiare punto di vista
CoderDojo - Galliate, 20 aprile 2013

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Classroom Observation Tools for Teachers
PPTX
GDM (1) (1).pptx small presentation for students
PDF
01-Introduction-to-Information-Management.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Pre independence Education in Inndia.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Complications of Minimal Access Surgery at WLH
PDF
RMMM.pdf make it easy to upload and study
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Pharma ospi slides which help in ospi learning
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
O7-L3 Supply Chain Operations - ICLT Program
Classroom Observation Tools for Teachers
GDM (1) (1).pptx small presentation for students
01-Introduction-to-Information-Management.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
VCE English Exam - Section C Student Revision Booklet
Anesthesia in Laparoscopic Surgery in India
Pre independence Education in Inndia.pdf
Institutional Correction lecture only . . .
Microbial disease of the cardiovascular and lymphatic systems
Complications of Minimal Access Surgery at WLH
RMMM.pdf make it easy to upload and study
2.FourierTransform-ShortQuestionswithAnswers.pdf
Insiders guide to clinical Medicine.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Module 4: Burden of Disease Tutorial Slides S2 2025
Pharma ospi slides which help in ospi learning

Shazam to Spotify - spike/demo web project

  • 1. Shazam to Spotify web demo project Converting a Shazam history in a Spotify playlist. Fabio Mora - http://fabio.mora.name
  • 2. Live at http://shazam2spotify.techeffe.net Source at https://github.com/morafabio/shazam2spotify/ Try it by downloading a sample Shazam history. Fabio Mora - http://fabio.mora.name
  • 3. Fabio Mora - http://fabio.mora.name
  • 4. Technologies ● Frontend ○ Twitter Bootstrap 3 ○ AngularJS ● Backend ○ PHP5.4 ○ Silex - a web microframework based on Symfony2 ○ Guzzle - a HTTP client for consuming web services ● Server ○ ○ ○ ○ A small cloud VPS Ubuntu 12.04 nginx php-fpm Fabio Mora - http://fabio.mora.name
  • 5. Coding notes ● C.R.C. cards ○ I started with those to clarify myself the domain model ● T.D.D. ○ I used Test Driven Development ■ ■ Karma is used for JS unit testing PHPUnit is used for unit and integration tests ● Covered by end to end tests ○ Selenium is used for functional tests ● Continuous Integration ○ Travis CI is used as CI server https://travis-ci.org/morafabio/shazam2spotify Fabio Mora - http://fabio.mora.name
  • 6. Coding notes ● Git as version control system ○ And hosted on GitHub https://github.com/morafabio/shazam2spotify/ ● Bash scripting ○ Repetitive tasks and builds are automated https://github.com/morafabio/shazam2spotify/tree/master/scripts ● Dependency managers ○ Composer for PHP ○ Bower for JS ○ NPM for Karma ● Design Patterns ○ Factory, Proxy, Mediator, Decorator (from the GoF) ○ Dependency Injection ○ MVC Fabio Mora - http://fabio.mora.name
  • 7. How it works 1. A file is uploaded to the server service via POST ● https://github.com/morafabio/shazam2spotify/blob/master/public/js/app.js#L9-L24 2. The controller handle the request ● https://github.com/morafabio/shazam2spotify/blob/master/public/service/app.php#L20-L41 3. The parser filters the input file ● https://github.com/morafabio/shazam2spotify/blob/master/src/Shazam2Spotify/Shazam/History.php#L27-L39 4. Domain object are generated: playlist and songs ● https://github.com/morafabio/shazam2spotify/tree/master/src/Shazam2Spotify/Common 5. Each song in the playlist is parsed ● https://github.com/morafabio/shazam2spotify/blob/master/src/Shazam2Spotify/Service/Locator.php#L24-L33 6. The Spotify Metadata API is consumed ● https://github.com/morafabio/shazam2spotify/blob/master/src/Shazam2Spotify/Spotify/Metadata.php 7. The response is sent back in JSON ● https://github.com/morafabio/shazam2spotify/blob/master/src/Shazam2Spotify/Common/Playlist.php#L24-L33 8. The view is rendered by the controller ● ● https://github.com/morafabio/shazam2spotify/blob/master/public/js/filters.js https://github.com/morafabio/shazam2spotify/blob/master/public/index.html#L66-L83 Fabio Mora - http://fabio.mora.name
  • 8. Thanks! Fabio Mora - http://fabio.mora.name