playstationnetwork-api 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/playstationnetwork/api.rb +3 -5
- data/lib/playstationnetwork/g/game.rb +2 -2
- data/lib/playstationnetwork/g/games.rb +2 -2
- data/lib/playstationnetwork/g/trophies.rb +2 -2
- data/lib/playstationnetwork/u/games.rb +2 -2
- data/lib/playstationnetwork/u/trophies.rb +3 -3
- data/lib/playstationnetwork/u/user.rb +2 -2
- data/lib/playstationnetwork/version.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76fa898f39d77d8b85920db372efd5157d2cf590
|
4
|
+
data.tar.gz: 5ce19e4071db0d20a02ab7a9fda1b22fd5085f09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63720efb6eaa630bba77fd731004ceb028a747666a25a1ca11fd1e0df40c98ff8fde58a9252960acf556de1c4cb5e7d793b13447ddabcc748dae305223550c34
|
7
|
+
data.tar.gz: 34735743f07ca2b51d84cb3dac38e26d1a2377634340566dddd31ddb2134da3381e24f8bd8fc4a7d045951c6c662ab95802ebebde9381df2d212adad2bcf56f0
|
@@ -6,11 +6,9 @@ module PlayStationNetwork
|
|
6
6
|
|
7
7
|
def self.config
|
8
8
|
{
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
response_type: 'json'
|
13
|
-
}
|
9
|
+
api_key: '4047cc6b66393a82a0c7d90844cf0d88b14e0c3a',
|
10
|
+
api_secret: 'pacMakaveli90',
|
11
|
+
response_type: 'json'
|
14
12
|
}
|
15
13
|
end
|
16
14
|
end
|
@@ -55,8 +55,8 @@ module PlayStationNetwork
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def self.find(psn_game_id)
|
58
|
-
|
59
|
-
|
58
|
+
options = PlayStationNetwork::API.config.merge({ npcommid: psn_game_id })
|
59
|
+
response = PlayStationNetwork::API.post('/psnGetGame', body: options)
|
60
60
|
|
61
61
|
if response.success?
|
62
62
|
parsed = JSON.parse(response)
|
@@ -22,8 +22,8 @@ module PlayStationNetwork
|
|
22
22
|
# => ps4 returns all PS4 games
|
23
23
|
#
|
24
24
|
def self.all(psn_platform = 'all')
|
25
|
-
|
26
|
-
|
25
|
+
options = PlayStationNetwork::API.config.merge({ platform: psn_platform })
|
26
|
+
response = PlayStationNetwork::API.post('/psnListGames', body: options)
|
27
27
|
|
28
28
|
sanitized_response = response.gsub('<?xml version=\"1.0\"?>', '').gsub('<\/', '</').tr('"', '')
|
29
29
|
parsed_response = Hash.from_xml(sanitized_response)
|
@@ -12,8 +12,8 @@ module PlayStationNetwork
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.all(psn_game_id)
|
15
|
-
|
16
|
-
|
15
|
+
options = PlayStationNetwork::API.config.merge({ npcommid: psn_game_id })
|
16
|
+
response = PlayStationNetwork::API.post('/psnGetTrophies', body: options)
|
17
17
|
|
18
18
|
if response.success?
|
19
19
|
parsed = JSON.parse(response)
|
@@ -10,8 +10,8 @@ module PlayStationNetwork
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.all(psn_user_id)
|
13
|
-
|
14
|
-
|
13
|
+
options = PlayStationNetwork::API.config.merge({ user_id: psn_user_id })
|
14
|
+
response = PlayStationNetwork::API.post('/psnGetUserGames', body: options)
|
15
15
|
|
16
16
|
if response.success?
|
17
17
|
parsed = JSON.parse(response)
|
@@ -9,9 +9,9 @@ module PlayStationNetwork
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.all(psn_user_id, psn_game_id)
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
options = PlayStationNetwork::API.config.merge({ user_id: psn_user_id, npcommid: psn_game_id })
|
13
|
+
response = PlayStationNetwork::API.post('/psnGetUserTrophies', body: options)
|
14
|
+
|
15
15
|
if response.success?
|
16
16
|
parsed = JSON.parse(response)
|
17
17
|
|
@@ -73,8 +73,8 @@ module PlayStationNetwork
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def self.profile(psn_user_id)
|
76
|
-
|
77
|
-
|
76
|
+
options = PlayStationNetwork::API.config.merge({ user_id: psn_user_id })
|
77
|
+
response = PlayStationNetwork::API.post('/psnGetUser', body: options)
|
78
78
|
|
79
79
|
if response.success?
|
80
80
|
parsed = JSON.parse(response)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module PlayStationNetwork
|
2
|
-
VERSION = '1.0.
|
2
|
+
VERSION = '1.0.2'
|
3
3
|
|
4
4
|
# Changelog
|
5
5
|
#
|
@@ -17,4 +17,5 @@ module PlayStationNetwork
|
|
17
17
|
# it's basically a new gem
|
18
18
|
# v1.0.1 - Fixes a bug where activesupport version would cause an issue with existing
|
19
19
|
# rails apps
|
20
|
+
# v1.0.2 - Adds correct hash format to pass the api key and secret to each route
|
20
21
|
end
|