Method: Tidal::ClientV1#get_search
- Defined in:
- lib/tidal/client_v1.rb
#get_search(query, country_code, type = nil, popularity = nil, offset = nil, limit = nil) ⇒ Hash
Search for content
285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/tidal/client_v1.rb', line 285 def get_search(query, country_code, type = nil, popularity = nil, offset = nil, limit = nil) uri = URI("#{BASE_URL}/search") params = { query: query, countryCode: country_code } params[:type] = type if type params[:popularity] = popularity if popularity params[:offset] = offset if offset params[:limit] = limit if limit uri.query = URI.encode_www_form(params) response = @client.request(:get, uri.to_s, headers: default_headers) JSON.parse(response.body) end |