Screenshots&Spotify

Made by MacKenzie Cherban

Found in Conversational Service

This project aims to get the countless amount of Siri/Shazam results off of the phone and into Spotify.

0

DESCRIPTION

Whenever I hear a song on the radio that I like, I ask Siri "who sings this?" I find my camera roll full of screenshots showing me the results. Up until this point, only the lucky few I remembered were added to my Spotify playlists. I wanted to create a handy bot that would take these screenshots and save them automatically for me.  

0

TECHNICAL IMPLEMENTATION

In order to get my screenshots to Spotify, I knew I would need a few things. I'm using and optical character recognition software (OCR Space), Spotify, Twilio, and Heroku.

OCR Space: https://github.com/suyesh/ocr_space

Spotify Gem, RSpotify: https://github.com/guilhermesad/rspotify

Twilio: https://www.twilio.com/

Heroku: https://www.heroku.com

0
#---- OCR SPACE ----

resource = OcrSpace::Resource.new(apikey: ENV["ocr_api_key"])
result = resource.clean_convert url: media_url
Click to Expand
0

OCR Space:

This gem is rather simple. When I sent my image via Twilio, it produces a media type and media url. All I needed to do was plug in the url via the gem documentation directions (see code above). This will feed me back a string of the results. Next, I needed to find the general convention and analyze the results to find the SONG_NAME and ARTIST_NAME. 

0
#---- RSPOTIFY ----

use Rack::Session::Cookie
use OmniAuth::Builder do
 provider :spotify, ENV["SPOTIFY_CLIENT_ID"], ENV["SPOTIFY_CLIENT_SECRET"], scope: 'user-read-private user-read-email playlist-read-private playlist-read-collaborative playlist-modify-public playlist-modify-private user-library-read user-library-modify'
end

RSpotify.authenticate(ENV["SPOTIFY_CLIENT_ID"], ENV["SPOTIFY_CLIENT_SECRET"])
spotify_user = RSpotify::User.new(@@spotify_auth)
Click to Expand
0

RSpotify:

To connect to Spotify, I needed to register my app and obtain all of the proper codes/tokens/keys. This wouldn't be necessary, however, I wanted to be able add, create, change a playlist on my profile. Once this was obtained, I was able to take the SONG_NAME and ARTIST_NAME and find a corresponding track. Then saving them to a newly created Spotify Playlist. 

0

OUTCOME

I choose to keep this bot very simple in it's task. Much like Digit, the user is limited in its option. The bot creates a default playlist, the user sends the screenshots that they want saved to the playlist. Right now the bot works as planned, I plan to work on this further and use the bot frequently in future. I also hope to share this with friends. 

0

THE BOT

While there is no snappy name...just yet. Screenshots&Spotify has a rather generic personality, with a hint of enthusiasm. Much like myself when I got the code for this bot to work. I wanted it to feel proud and excited that it found the songs and saved them to Spotify. I had pivoted last minute to accomplish this idea, so while I was able to rework my workflow and data diagram, the wizard of oz exercise was actually conducted using a different concept. The pivot occurred in time to allow me to scrap together an experience prototype. Here I walked people through my concept and the user flow. I made sure to screenshot all of the responses in order to help foster ideas as well as hone the language being used. 

0

The data diagram will be ever evolving as I begin to build my database in the next few weeks. I know that I will need to account for images sent (as to not have repeats), playlists created, playlist in use, and user session, to name a few. 

0

FUTURE WORK

I have grand plans for the future of this bot, as well as my original concept. In the near future, I plan to fix issues with the OCR results to account for Siri's range of responses. As mentioned above, I am also planning and mapping the database I will use to store crucial information for the user and their profiles. I would also like to explore the idea of changing playlists, viewing saved tracks, and perhaps even playing a random song (thanks Daragh during the experience prototype)!

x
Share this Project

This project is only accessible by signed in users. Be considerate and think twice before sharing.


Courses

49714 Programming for Online Prototypes

· 15 members

A hands on introduction to building online products and services through code


About

This project aims to get the countless amount of Siri/Shazam results off of the phone and into Spotify.

Created

October 19th, 2017