fortnite 0.0.0
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 +7 -0
- data/lib/fortnite.rb +96 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cd8c9c785fcf3f74bcbdef377284e875cd186118223fda69090bc5e84c62196f
|
4
|
+
data.tar.gz: 9325ad3d8e17fa66b8e847512c2356b2270f8dcb7dff2822049e873fc25ce4eb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 63bd50373dfea0456758ea7308a5330e8a5d9fee47c32a8b55de6b7e1e8141865053e66abee8fd6c2fe532e4ece9a0913342283fc1bb4558f8478f316113e6da
|
7
|
+
data.tar.gz: 4187039d865f72b821fb8e494a944df2a70ff138ccf95789f65be09ba5229c1c9fce4848d79b231cac79c72f437ee554bf573ff6523912277e5ffdbc53512dc1
|
data/lib/fortnite.rb
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class Fortnite
|
5
|
+
BaseUrl = 'https://fortnite-public-api.theapinetwork.com'
|
6
|
+
|
7
|
+
def daily_store
|
8
|
+
begin
|
9
|
+
request = RestClient.get BaseUrl + '/prod09/store/get'
|
10
|
+
JSON.parse(request.body)
|
11
|
+
rescue Exception => e
|
12
|
+
puts "Error: #{e}"
|
13
|
+
{}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def upcoming_items
|
18
|
+
begin
|
19
|
+
request = RestClient.get BaseUrl + '/prod09/upcoming/get'
|
20
|
+
JSON.parse(request.body)
|
21
|
+
rescue StandardError => e
|
22
|
+
puts "Error: #{e}"
|
23
|
+
{}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def items
|
28
|
+
begin
|
29
|
+
request = RestClient.get BaseUrl + '/prod09/items/list'
|
30
|
+
JSON.parse(request.body)
|
31
|
+
rescue StandardError => e
|
32
|
+
puts "Error: #{e}"
|
33
|
+
{}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def user_id nickname
|
38
|
+
begin
|
39
|
+
request = RestClient.get BaseUrl + "/prod09/users/id?username=#{nickname}"
|
40
|
+
JSON.parse(request.body)
|
41
|
+
rescue StandardError => e
|
42
|
+
puts "Error: #{e}"
|
43
|
+
{}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def user_stats id
|
48
|
+
begin
|
49
|
+
request = RestClient.get BaseUrl + "/prod09/users/public/br_stats_v2?user_id=#{id}"
|
50
|
+
JSON.parse(request.body)
|
51
|
+
rescue StandardError => e
|
52
|
+
"Error #{e}"
|
53
|
+
{}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def user_matches id
|
58
|
+
begin
|
59
|
+
request = RestClient.get BaseUrl + "/prod09/users/public/matches_v2?user_id=#{id}"
|
60
|
+
JSON.parse(request.body)
|
61
|
+
rescue Exception => e
|
62
|
+
puts "Error: #{e}"
|
63
|
+
{}
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def challenges season
|
68
|
+
begin
|
69
|
+
request = RestClient.get BaseUrl + "/prod09/challenges/get?season=#{season}"
|
70
|
+
JSON.parse(request.body)
|
71
|
+
rescue Exception => e
|
72
|
+
puts "Error: #{e}"
|
73
|
+
{}
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def weapons
|
78
|
+
begin
|
79
|
+
request = RestClient.get BaseUrl + '/prod09/weapons/get'
|
80
|
+
JSON.parse(request.body)
|
81
|
+
rescue Exception => e
|
82
|
+
puts "Error: #{e}"
|
83
|
+
{}
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def server_status
|
88
|
+
begin
|
89
|
+
request = RestClient.get BaseUrl + '/prod09/status/fortnite_server_status'
|
90
|
+
JSON.parse(request.body)
|
91
|
+
rescue Exception => e
|
92
|
+
puts "Error: #{e}"
|
93
|
+
{}
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fortnite
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Juanse Gimenez
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-03-30 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Retrieve informations from Fortnite with fortniteapi.com API, with a
|
14
|
+
lot of resource to use.
|
15
|
+
email: juansegimenez94@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/fortnite.rb
|
21
|
+
homepage: http://rubygems.org/gems/fortnite
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.7.6
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Fortnite api free
|
45
|
+
test_files: []
|