Created
March 18, 2015 14:03
-
-
Save rinx/633ad961af429a1e7a80 to your computer and use it in GitHub Desktop.
A sample script of grooveshark gem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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