class SpotifySearcher
- SpotifySearcher
- Reference
- Object
Defined in:
search/spotify.crInstance Method Summary
-
#authorize(client_id : String, client_secret : String) : self
Saves an access token for future program use with spotify using client IDs.
-
#authorized? : Bool
Check if the class is authorized or not
-
#find_genre(id : String) : String | Nil
Find the genre of an artist based off of their id
-
#find_item(item_type : String, item_parameters : Hash, offset = 0, limit = 20) : JSON::Any | Nil
Searches spotify with the specified parameters for the specified items
-
#find_user_playlist(username : String, name : String, offset = 0, limit = 20) : JSON::Any | Nil
Grabs a users playlists and searches through it for the specified playlist
-
#get_item(item_type : String, id : String, offset = 0, limit = 100) : JSON::Any
Get the complete metadata of an item based off of its id
-
#get_playlist(id, offset = 0, limit = 100) : JSON::Any
The only way this method differs from
#get_item
is that it makes sure to insert ALL tracks from the playlist into theJSON::Any
Instance Method Detail
Saves an access token for future program use with spotify using client IDs. Specs defined on spotify's developer api: https://developer.spotify.com/documentation/general/guides/authorization-guide/#client-credentials-flow
SpotifySearcher.new.authorize("XXXXXXXXXX", "XXXXXXXXXX")
Find the genre of an artist based off of their id
SpotifySearcher.new.authorize(...).find_genre("1dfeR4HaWDbWqFHLkxsg1d")
Searches spotify with the specified parameters for the specified items
spotify_searcher.find_item("track", {
"artist" => "Queen",
"track" => "Bohemian Rhapsody"
})
=> {track metadata}
Grabs a users playlists and searches through it for the specified playlist
spotify_searcher.find_user_playlist("prakkillian", "the little man")
=> {playlist metadata}
Get the complete metadata of an item based off of its id
SpotifySearcher.new.authorize(...).get_item("artist", "1dfeR4HaWDbWqFHLkxsg1d")
The only way this method differs from #get_item
is that it makes sure to
insert ALL tracks from the playlist into the JSON::Any
SpotifySearcher.new.authorize(...).get_playlist("122Fc9gVuSZoksEjKEx7L0")