fortniteapi 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fortniteapi/api.rb +9 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9356d56bb89faa1c7b3c786ba9ca46ec20bdd6e018b6cbc6a85aa31e68aad532
4
- data.tar.gz: 3db50bb8c90b4e6807fe742f808f3c1baf0d5c25b8705cbc92abf0b29c3674d0
3
+ metadata.gz: 4453e8efbcccc54d1c91ccd249250a5f5dba2915d6193a65755cfb530495f430
4
+ data.tar.gz: da1b275cd6dc8c5211e892f37be565c7d2e9915780665e3d1f07f54ab93e03f7
5
5
  SHA512:
6
- metadata.gz: e07b7de916d4898889c2de430289901010a5fefd9b73daf0ff509c523a521cf3f228f61b258fc988c4eaa48481ad28deb3a36afd4f288c930e49d4a749a09261
7
- data.tar.gz: 81c63bed578fd95a5aae101406c7f207826f0182e2a0a54456a112d9b51c2fdde7cbe5c7f354af18c7056aefed4a24996b7d64ea8b873c09695aba4fb256b567
6
+ metadata.gz: 1cb64d1de3984cc429203f2cedff57ebdf4ae0a480790c4c2e18dcbbe2b78b5827375337005d64d76b22c63d9964b704dad96610b77c568cb396c0a9c4ba1d01
7
+ data.tar.gz: dfd5755d6143c43a3f09749b2cf3ec2b8b925e9a2c61bb50bb35f2f74af6e8566eb232c0fb43b5b692f7e50c16828eac9c34b81336c0cc299a47f2d53247d2f3
@@ -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'])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortniteapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - xMistt