require 'uri'
+require 'cgi'
require 'net/http'
require 'multi_json'
require 'nokogiri'
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
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
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
# @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", "+")
end
end
end