Skip to content

Instantly share code, notes, and snippets.

@rinx
Created March 18, 2015 14:03
Show Gist options
  • Save rinx/633ad961af429a1e7a80 to your computer and use it in GitHub Desktop.
Save rinx/633ad961af429a1e7a80 to your computer and use it in GitHub Desktop.
A sample script of grooveshark gem.
# -*- coding: utf-8 -*-
require 'grooveshark'
client = Grooveshark::Client.new
songs = client.search_songs('素晴らしい世界 FLOWER FLOWER')
songs.each do |s|
puts "#{s.name} - #{s.artist}"
end
song = songs[0]
songurl = client.get_song_url(song)
system("mplayer -slave -really-quiet #{songurl}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment