steamwebapi 1.0.0 → 1.0.1
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/README.md +5 -3
- data/lib/steamwebapi.rb +1 -0
- data/lib/steamwebapi/app.rb +1 -0
- data/lib/steamwebapi/steamapi.rb +10 -6
- data/lib/steamwebapi/user.rb +1 -0
- data/steamwebapi.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1625e199aa2355d794b7b7d0f39677aa5c4f4ec6
|
4
|
+
data.tar.gz: 371bad280ff81336ce78e87f692750c12e6389f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b14fde02325d91600fe83ea92dc3dd6a7ada19b2cb517d83e03ba22dce867482991f8918666b429fc095b347023ccdea48fb714d44c634cf111e06e246f5833
|
7
|
+
data.tar.gz: 0dbe1574c1da5b3ab6047f96c70001568f8a79cd126c14465ea8eff4fcd8cfb0dc79b625dbd661569b1e6681019b96b60ce5f23194cb511b9b5428ae914969ad
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
Steam web API
|
2
2
|
===
|
3
3
|
|
4
|
+
[](http://badge.fury.io/rb/steamwebapi)
|
5
|
+
|
4
6
|
Steam Web API library in Ruby. Retrieves and parses JSON data. If you want more information about the API go to:
|
5
7
|
|
6
8
|
* http://steamcommunity.com/dev
|
@@ -15,11 +17,11 @@ Steam Web API library in Ruby. Retrieves and parses JSON data. If you want more
|
|
15
17
|
|
16
18
|
Open up your terminal or cmd or whatever and copypasta this code
|
17
19
|
|
18
|
-
|
20
|
+
gem install steamwebapi
|
19
21
|
|
20
22
|
To use it in your application, add the following to your Gemfile:
|
21
23
|
|
22
|
-
gem 'steamwebapi'
|
24
|
+
gem 'steamwebapi', '~> 1.0.0'
|
23
25
|
|
24
26
|
## Usage
|
25
27
|
|
data/lib/steamwebapi.rb
CHANGED
data/lib/steamwebapi/app.rb
CHANGED
data/lib/steamwebapi/steamapi.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
require 'net/http'
|
2
3
|
require 'json'
|
4
|
+
require 'rexml/document'
|
3
5
|
|
4
6
|
module SteamAPI
|
5
7
|
def self.get(interface, method, version, args = {})
|
6
|
-
json = true
|
7
8
|
if args.empty?
|
8
9
|
raise 'cannot retrieve data without arguments'
|
9
10
|
else
|
10
11
|
i = ''
|
11
12
|
args.each do |key, value|
|
12
|
-
# the first
|
13
|
+
# the first argument needs ? in front of it
|
13
14
|
if key == args.keys[0]
|
14
15
|
i += "?#{key}=#{value}"
|
15
16
|
else
|
@@ -19,10 +20,13 @@ module SteamAPI
|
|
19
20
|
domain = "http://api.steampowered.com/#{interface}/#{method}/#{version}/#{i}"
|
20
21
|
end
|
21
22
|
uri = Net::HTTP.get(URI(domain))
|
22
|
-
|
23
|
-
|
23
|
+
case args.key('format')
|
24
|
+
when 'xml'
|
25
|
+
uri
|
26
|
+
when 'vdf'
|
27
|
+
uri
|
24
28
|
else
|
25
|
-
|
29
|
+
JSON.parse(uri)
|
26
30
|
end
|
27
31
|
end
|
28
|
-
end
|
32
|
+
end
|
data/lib/steamwebapi/user.rb
CHANGED
data/steamwebapi.gemspec
CHANGED
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "steamwebapi"
|
7
|
-
spec.version = "1.0.
|
7
|
+
spec.version = "1.0.1"
|
8
8
|
spec.authors = ["kuzmaa"]
|
9
9
|
spec.email = [""]
|
10
10
|
spec.summary = %q{Steam Web API library in Ruby}
|
11
|
-
spec.description = %q{Retrieves and parses JSON data, which it
|
11
|
+
spec.description = %q{Retrieves and parses JSON data, which it gets from http://api.steampowered.com}
|
12
12
|
spec.homepage = "https://github.com/kuzmaa/steamwebapi"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steamwebapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kuzmaa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description: Retrieves and parses JSON data, which it
|
41
|
+
description: Retrieves and parses JSON data, which it gets from http://api.steampowered.com
|
42
42
|
email:
|
43
43
|
- ''
|
44
44
|
executables: []
|