class Fortnite

Constants

BaseUrl

Public Instance Methods

challenges(season) click to toggle source
# File lib/fortnite.rb, line 67
def challenges season
  begin    
    request = RestClient.get BaseUrl + "/prod09/challenges/get?season=#{season}"
    JSON.parse(request.body)
  rescue Exception => e
    puts "Error: #{e}"
    {}
  end
end
daily_store() click to toggle source
# File lib/fortnite.rb, line 7
def daily_store
  begin
    request = RestClient.get BaseUrl + '/prod09/store/get'
    JSON.parse(request.body)
  rescue Exception => e
    puts "Error: #{e}"
    {}
  end
end
items() click to toggle source
# File lib/fortnite.rb, line 27
def items
  begin
    request = RestClient.get BaseUrl + '/prod09/items/list'
    JSON.parse(request.body)
  rescue StandardError => e
    puts "Error: #{e}"
    {}
  end
end
server_status() click to toggle source
# File lib/fortnite.rb, line 87
def server_status
  begin
    request = RestClient.get BaseUrl + '/prod09/status/fortnite_server_status'
    JSON.parse(request.body)
  rescue Exception => e
    puts "Error: #{e}"
    {}
  end
end
upcoming_items() click to toggle source
# File lib/fortnite.rb, line 17
def upcoming_items
  begin
    request = RestClient.get BaseUrl + '/prod09/upcoming/get'
    JSON.parse(request.body)
  rescue StandardError => e
    puts "Error: #{e}"
    {}
  end
end
user_id(nickname) click to toggle source
# File lib/fortnite.rb, line 37
def user_id nickname
  begin
    request = RestClient.get BaseUrl + "/prod09/users/id?username=#{nickname}"
    JSON.parse(request.body)
  rescue StandardError => e
    puts "Error: #{e}"
    {}
  end
end
user_matches(id) click to toggle source
# File lib/fortnite.rb, line 57
def user_matches id
  begin
    request = RestClient.get BaseUrl + "/prod09/users/public/matches_v2?user_id=#{id}"
    JSON.parse(request.body)      
  rescue Exception => e
    puts "Error: #{e}"
    {}
  end
end
user_stats(id) click to toggle source
# File lib/fortnite.rb, line 47
def user_stats id 
  begin
    request = RestClient.get BaseUrl + "/prod09/users/public/br_stats_v2?user_id=#{id}"
    JSON.parse(request.body)
  rescue StandardError => e
    "Error #{e}"
    {}
  end
end
weapons() click to toggle source
# File lib/fortnite.rb, line 77
def weapons
  begin
    request = RestClient.get BaseUrl + '/prod09/weapons/get'
    JSON.parse(request.body)
  rescue Exception => e
    puts "Error: #{e}"
    {}
  end
end