summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
7b40d72)
NOTE: Rdio doesn't work in 1.8 :(
require 'net/http'
require 'multi_json'
require 'nokogiri'
require 'net/http'
require 'multi_json'
require 'nokogiri'
def current_track
artist = ARGV[0]
song = ARGV[1]
def current_track
artist = ARGV[0]
song = ARGV[1]
- {artist: artist, song: song}
+ {:artist => artist, :song => song}
end
# The reset method resets any configurations it may have
end
# The reset method resets any configurations it may have
path = File.join(path_root, @script)
current = `osascript #{path}`
current = current.split("<-SEP->")
path = File.join(path_root, @script)
current = `osascript #{path}`
current = current.split("<-SEP->")
- {artist: current[0], song: current[1]}
+ {:artist => current[0], :song => current[1]}
end
# The reset method resets any configurations it may have
end
# The reset method resets any configurations it may have
response = @rdio.call('currentUser', {'extras' => 'lastSongPlayed'})
artist = response["result"]["lastSongPlayed"]["artist"]
song = response["result"]["lastSongPlayed"]["name"]
response = @rdio.call('currentUser', {'extras' => 'lastSongPlayed'})
artist = response["result"]["lastSongPlayed"]["artist"]
song = response["result"]["lastSongPlayed"]["name"]
- {artist: artist, song: song}
+ {:artist => artist, :song => song}
end
# The reset method resets any configurations it may have
end
# The reset method resets any configurations it may have
# @param [String] p the parameter to be sanitized
# @return [String] the sanitized parameter
def sanitize_param(p)
# @param [String] p the parameter to be sanitized
# @return [String] the sanitized parameter
def sanitize_param(p)
- URI.encode_www_form_component(p.gsub(/ /, "+")).gsub("%2B", "+")
+ CGI.escape(p.gsub(/ /, "+")).gsub("%2B", "+")