fortniteapi 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fortniteapi/api.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfbfc95576667a4829786b5abf7644f9f4ab46d7c6e8cdb10b55e4f8599bc0d7
|
4
|
+
data.tar.gz: fd6dd6c60e471b3ab039e7d0a7d59720a0a3c6f5c9f7d9638b1ce7641a5cb31a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd9caaddc73a25e9df8eb51b9742060345d18484d1fa12f86d75eebb14098179a7f702fe0ff865e2d56330e8f8d43bde24d1e83ceb297d2d4004d1f4dcd2013e
|
7
|
+
data.tar.gz: 64fd27d6d83b77efd31bf3c11b806ccddd12971ba55061fff49a0ec495fce2e34eb0b79c5ea3840c15b5262ae390cba32853d8ec0f691839a751f5f901efc4ef
|
data/lib/fortniteapi/api.rb
CHANGED
@@ -6,6 +6,7 @@ class FortniteAPI
|
|
6
6
|
STWNews = Struct.new(:image, :hidden, :messageType, :type, :adspace, :spotlight, :title, :body)
|
7
7
|
CreativeNews = Struct.new(:image, :hidden, :messageType, :type, :adspace, :spotlight, :title, :body)
|
8
8
|
ShopItem = Struct.new(:regularPrice, :finalPrice, :isBundle, :giftable, :refundable, :panel, :sortPriority, :banner, :items)
|
9
|
+
CreatorCode = Struct.new(:id, :slug, :displayName, :status, :verified)
|
9
10
|
|
10
11
|
def search_cosmetic(searchQuery, tag='name', language='en', searchLanguage='en')
|
11
12
|
response = HTTParty.get("https://fortnite-api.com/cosmetics/br/search?#{tag}=#{searchQuery}&language=#{language}&searchLanguage=#{searchLanguage}")
|
@@ -28,6 +29,11 @@ class FortniteAPI
|
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
32
|
+
def get_creator_code(slug)
|
33
|
+
repsonse = HTTParty.get("https://fortnite-api.com/creatorcode/search?slug=#{slug}")
|
34
|
+
body = JSON.parse(response.body)['data']
|
35
|
+
supportACreator = CreatorCode.new(body['id'], body['slug'], body['displayName'], body['status'], body['verified'])
|
36
|
+
|
31
37
|
def search_cosmetic_id(searchQuery, language='en')
|
32
38
|
response = HTTParty.get("https://fortnite-api.com/cosmetics/br/#{searchQuery}&language=#{language}")
|
33
39
|
body = JSON.parse(response.body)['data']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fortniteapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xMistt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|