delight.fm: day 8

Working with third-party code

Ryan Strickler
Jan 30, 2017 · 2 min read

I started preparing to retrieve album information today. Logging in with Spotify is working well and I need to figure out how to reconnect when needed to in order to do things besides just log in.

The rspotify gem I’m using provides a way to do just this. Store the object in a hash and re-constitute it as needed when I want to reconnect. The upside of using a library like this is to offload things like refreshing access tokens and provide a nice way to get the data I want. Should save time. The downside is having to dig into unfamiliar code if there are problems.

Unfortunately, I’m running into a problem. Once I recreate the rspotify object, I’m getting an error when trying to pull album data. Hopefully it’s just an error on my part with how I’m using the library. I’ll revisit tomorrow and see if I can figure it out. If not, I may have to abandon ship and either try another gem or connect to the API directly.

Be careful when choosing third-party code to add to your application. It’s easy to get into a situation where it’s costing you more time than it’s worth. On the other hand, you don’t want to fall into the trap of having to building everything yourself and not benefitting from using the tools that are available to you. So try out libraries, but just remember that there may be hidden costs involved. With experience, you’ll develop a sense of which projects are long-lived and stable enough to trust.

Little King: Daily Log

Building something every day.

Ryan Strickler

Written by

Building something every day. Launching something new every 6 weeks. Writing about everything along the way.

Little King: Daily Log

Building something every day. Launching something new every 7 weeks. Writing about everything along the way.

Ryan Strickler

Written by

Building something every day. Launching something new every 6 weeks. Writing about everything along the way.

Little King: Daily Log

Building something every day. Launching something new every 7 weeks. Writing about everything along the way.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store