fortniteapi 0.0.4 → 0.0.5
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 +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4453e8efbcccc54d1c91ccd249250a5f5dba2915d6193a65755cfb530495f430
|
4
|
+
data.tar.gz: da1b275cd6dc8c5211e892f37be565c7d2e9915780665e3d1f07f54ab93e03f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb64d1de3984cc429203f2cedff57ebdf4ae0a480790c4c2e18dcbbe2b78b5827375337005d64d76b22c63d9964b704dad96610b77c568cb396c0a9c4ba1d01
|
7
|
+
data.tar.gz: dfd5755d6143c43a3f09749b2cf3ec2b8b925e9a2c61bb50bb35f2f74af6e8566eb232c0fb43b5b692f7e50c16828eac9c34b81336c0cc299a47f2d53247d2f3
|
data/lib/fortniteapi/api.rb
CHANGED
@@ -14,7 +14,7 @@ class FortniteAPI
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def search_cosmetic(searchQuery, tag='name', language='en', searchLanguage='en')
|
17
|
-
response = HTTParty.get("https://fortnite-api.com/cosmetics/br/search?#{tag}=#{searchQuery}&language=#{language}&searchLanguage=#{searchLanguage}", :headers => headers)
|
17
|
+
response = HTTParty.get("https://fortnite-api.com/cosmetics/br/search?#{tag}=#{searchQuery}&language=#{language}&searchLanguage=#{searchLanguage}", :headers => @headers)
|
18
18
|
body = JSON.parse(response.body)['data']
|
19
19
|
if response.code == 200
|
20
20
|
searchResult = BRCosmetic.new(body['id'], body['type'], body['backendType'], body['rarity'], body['displayRarity'], body['backendRarity'], body['name'], body['shortDescription'], body['description'], body['set'], body['setText'], body['backendSeries'], body['images'], body['variants'], body['gameplayTags'], body['displayAssetPath'], body['definition'], body['requiredItemId'], body['builtInEmoteId'], body['path'], body['lastUpdate'], body['added'])
|
@@ -35,14 +35,14 @@ class FortniteAPI
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def get_creator_code(slug)
|
38
|
-
response = HTTParty.get("https://fortnite-api.com/creatorcode/search?slug=#{slug}", :headers => headers)
|
38
|
+
response = HTTParty.get("https://fortnite-api.com/creatorcode/search?slug=#{slug}", :headers => @headers)
|
39
39
|
body = JSON.parse(response.body)['data']
|
40
40
|
supportACreator = CreatorCode.new(body['id'], body['slug'], body['displayName'], body['status'], body['verified'])
|
41
41
|
supportACreator
|
42
42
|
end
|
43
43
|
|
44
44
|
def search_cosmetic_id(searchQuery, language='en')
|
45
|
-
response = HTTParty.get("https://fortnite-api.com/cosmetics/br/#{searchQuery}&language=#{language}", :headers => headers)
|
45
|
+
response = HTTParty.get("https://fortnite-api.com/cosmetics/br/#{searchQuery}&language=#{language}", :headers => @headers)
|
46
46
|
body = JSON.parse(response.body)['data']
|
47
47
|
if response.code == 200
|
48
48
|
searchResult = BRCosmetic.new(body['id'], body['type'], body['backendType'], body['rarity'], body['displayRarity'], body['backendRarity'], body['name'], body['shortDescription'], body['description'], body['set'], body['setText'], body['backendSeries'], body['images'], body['variants'], body['gameplayTags'], body['displayAssetPath'], body['definition'], body['requiredItemId'], body['builtInEmoteId'], body['path'], body['lastUpdate'], body['added'])
|
@@ -64,7 +64,7 @@ class FortniteAPI
|
|
64
64
|
|
65
65
|
def search_cosmetics(searchQuery, tag='name', language='en', searchLanguage='en')
|
66
66
|
cosmetics = []
|
67
|
-
response = HTTParty.get("https://fortnite-api.com/cosmetics/br/search/all?#{tag}=#{searchQuery}&language=#{language}&searchLanguage=#{searchLanguage}", :headers => headers)
|
67
|
+
response = HTTParty.get("https://fortnite-api.com/cosmetics/br/search/all?#{tag}=#{searchQuery}&language=#{language}&searchLanguage=#{searchLanguage}", :headers => @headers)
|
68
68
|
body = JSON.parse(response.body)['data']
|
69
69
|
if response.code == 200
|
70
70
|
for x in body
|
@@ -88,13 +88,13 @@ class FortniteAPI
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def all_cosmetics()
|
91
|
-
response = HTTParty.get("https://fortnite-api.com/cosmetics/br", :headers => headers)
|
91
|
+
response = HTTParty.get("https://fortnite-api.com/cosmetics/br", :headers => @headers)
|
92
92
|
JSON.parse(response.body)
|
93
93
|
end
|
94
94
|
|
95
95
|
def get_br_news(language='en')
|
96
96
|
br_news_list = []
|
97
|
-
response = HTTParty.get("https://fortnite-api.com/news/br?language=#{language}", :headers => headers)
|
97
|
+
response = HTTParty.get("https://fortnite-api.com/news/br?language=#{language}", :headers => @headers)
|
98
98
|
messages = JSON.parse(response.body)['data']['messages']
|
99
99
|
for x in messages
|
100
100
|
newsResult = BRNews.new(x['image'], x['hidden'], x['messageType'], x['type'], x['adspace'], x['spotlight'], x['title'], x['body'])
|
@@ -105,7 +105,7 @@ class FortniteAPI
|
|
105
105
|
|
106
106
|
def get_stw_news(language='en')
|
107
107
|
stw_news_list = []
|
108
|
-
response = HTTParty.get("https://fortnite-api.com/news/stw?language=#{language}", :headers => headers)
|
108
|
+
response = HTTParty.get("https://fortnite-api.com/news/stw?language=#{language}", :headers => @headers)
|
109
109
|
messages = JSON.parse(response.body)['data']['messages']
|
110
110
|
for x in messages
|
111
111
|
newsResult = STWNews.new(x['image'], x['hidden'], x['messageType'], x['type'], x['adspace'], x['spotlight'], x['title'], x['body'])
|
@@ -116,7 +116,7 @@ class FortniteAPI
|
|
116
116
|
|
117
117
|
def get_creative_news(language='en')
|
118
118
|
creative_news_list = []
|
119
|
-
response = HTTParty.get("https://fortnite-api.com/news/creative?language=#{language}", :headers => headers)
|
119
|
+
response = HTTParty.get("https://fortnite-api.com/news/creative?language=#{language}", :headers => @headers)
|
120
120
|
messages = JSON.parse(response.body)['data']['messages']
|
121
121
|
for x in messages
|
122
122
|
newsResult = CreativeNews.new(x['image'], x['hidden'], x['messageType'], x['type'], x['adspace'], x['spotlight'], x['title'], x['body'])
|
@@ -128,7 +128,7 @@ class FortniteAPI
|
|
128
128
|
def get_br_store(language='en')
|
129
129
|
featured_items = []
|
130
130
|
daily_items = []
|
131
|
-
response = HTTParty.get("https://fortnite-api.com/shop/br?language=#{language}", :headers => headers)
|
131
|
+
response = HTTParty.get("https://fortnite-api.com/shop/br?language=#{language}", :headers => @headers)
|
132
132
|
featured = JSON.parse(response.body)['data']['featured']
|
133
133
|
for x in featured
|
134
134
|
featuredItem = ShopItem.new(x['regularPrice'], x['finalPrice'], x['isBundle'], x['giftable'], x['refundable'], x['panel'], x['sortPriority'], x['banner'], x['items'])
|