class Spotify::SpAPI

Service for all Spotify API calls

Constants

API_VER
SEARCH_TYPE
SP_API_URL
SP_URL

Public Class Methods

search_feed(input) click to toggle source
# File lib/spotifysearch/spotify_api.rb, line 13
def self.search_feed(input)
  search_response = HTTP.get(
    URI.join(SP_API_URL, 'search'),
    params: { q: input, type: SEARCH_TYPE }
  )
  rawfeed = JSON.parse(search_response.to_s)['tracks']['items']
  Spotify::SongsHash.create(rawfeed)
end