A Ruby script for MPD
1 2 #!/usr/bin/ruby 3 #file: mp_control.rb 4 5 require 'open-uri' 6 cmd = ARGV[0] 7 open("http://192.168.1.107/phpMp/playlist.php?hide=1&command=#{cmd}", 'User-Agent' => 'Ruby-MPClient').read 8
Example: mp_control.rb play
DZone Snippets > jrobertson > argv
13387 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
James Robertson http://www.r0bertson.co.uk
1 2 #!/usr/bin/ruby 3 #file: mp_control.rb 4 5 require 'open-uri' 6 cmd = ARGV[0] 7 open("http://192.168.1.107/phpMp/playlist.php?hide=1&command=#{cmd}", 'User-Agent' => 'Ruby-MPClient').read 8