Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Example usage of the Hallon gem to login to Spotify, search for tracks and play a song
require 'hallon'
require 'hallon/openal'
session = Hallon::Session.initialize'./spotify_appkey.key')
session.login!('johndoe', 'superpassword')
search ="Daft Punk Get Lucky")
tracks = search.tracks[0...5].map(&:load)
puts "Top 5 Results"
tracks.each do |track|
puts "#{} - #{}"
player =!(tracks.first)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment