Created
August 5, 2011 11:11
-
-
Save PirosB3/1127325 to your computer and use it in GitHub Desktop.
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
require "net/http" | |
request = Net::HTTP.new("grooveshark.com") | |
path = '/more.php?getCountry' | |
data = '{"method":"getCountry"}' | |
headers = {'Host' => 'grooveshark.com', | |
'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1', | |
'Accept-Encoding' => 'gzip, deflate', | |
'Accept-Charset' => 'utf-8', | |
'Connection' => 'keep-alive' | |
} | |
resp, data = request.post(path, data, headers) | |
puts resp.body.force_encoding("utf-8") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment