grooveshark 0.2.8.2 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grooveshark/client.rb +8 -2
- data/lib/grooveshark/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4b7dfe5b1d75551f6d9991500bd51410105bbf6
|
4
|
+
data.tar.gz: a0e90517ea68482399f001c63c9e92f2108c0fc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 203b0405c3b0d4b4c9d95aedb3a5665c3219914943306e927ad48c7a4eb3b97cb1c99ee756660140fa201814787af668b1f1f7efb9be01f8f01f60bb17ccbf7f
|
7
|
+
data.tar.gz: 2458b45328a4a59b8876043196b72ab7c62ad8edc3ff9a284be0da13adc57314225bb5d5fbb628b1f5c1a199135a27ff7fc2aa3a6a1eb04dbc3c703b3c60a377
|
data/lib/grooveshark/client.rb
CHANGED
@@ -92,9 +92,15 @@ module Grooveshark
|
|
92
92
|
def get_session_and_country
|
93
93
|
response = RestClient.get('http://grooveshark.com')
|
94
94
|
session = response.headers[:set_cookie].to_s.scan(/PHPSESSID=([a-z\d]{32});/i).flatten.first
|
95
|
-
|
95
|
+
|
96
|
+
preload_regex = /gsPreloadAjax\(\{url: '\/preload.php\?(.*)&hash=' \+ clientPage\}\)/
|
97
|
+
preload_id = response.to_s.scan(preload_regex).flatten.first
|
98
|
+
preload_url = "http://grooveshark.com/preload.php?#{preload_id}&getCommunicationToken=1&hash=%2F"
|
99
|
+
preload_response = RestClient.get(preload_url)
|
100
|
+
|
101
|
+
config_json = preload_response.to_s.scan(/window.tokenData = (.*);/).flatten.first
|
96
102
|
raise GeneralError, "gsConfig not found" if not config_json
|
97
|
-
config = JSON.parse(config_json)
|
103
|
+
config = JSON.parse(config_json)['getGSConfig']
|
98
104
|
[session, config['country']]
|
99
105
|
end
|
100
106
|
|
data/lib/grooveshark/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grooveshark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Sosedoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|