PlayerDB
Powerful, but simple, unofficial client to interface with the PlayerDB API.
1. Installation
Please note that the gem name is case sensitive.
gem install PlayerDB
2. Usage Guides
Firstly, require and initialize the library like so:
require "playerdb"
@Player = PlayerDB::Client.new
begin
@Minecraft = @Player.Minecraft("jinzulen")
puts "# General profile information:"
puts "# ID: #{@Minecraft["id"]}"
puts "# Raw ID: #{@Minecraft["raw_id"]}"
puts "# Username: #{@Minecraft["username"]}"
puts "# Avatar: #{@Minecraft["avatar"]}\n\n"
@History = @Minecraft["meta"]["name_history"]
if @History.length > 1
puts "# Name change history:"
@History.each do |n|
puts "# #{n["name"]} <= Changed at: #{n["changedToAt"]}"
end
end
rescue StandardError => e
puts "#{e}"
end
profilestate: The visibility status of the user's profile.
personatestate: The user's current online status.
begin
@Steam = @Player.Steam("jinzulen")
puts "# Profile:"
puts "# ID: #{@Steam["id"]}"
puts "# Username: #{@Steam["username"]}"
puts "# Avatar: #{@Steam["avatar"]}\n\n"
puts "# Miscellaneous:"
@Steam["meta"].each { |m| puts "# #{m[0]}: #{m[1]}"}
rescue StandardError => e
puts "#{e}"
end
begin
@Xbox = @Player.Xbox("Stallion83")
puts "# Profile:"
puts "# ID: #{@Xbox["id"]}"
puts "# Username: #{@Xbox["username"]}"
puts "# Avatar: #{@Xbox["avatar"]}"
puts "# Gamer score: #{@Xbox["meta"]["gamerscore"]}"
puts "# Account tier: #{@Xbox["meta"]["accountTier"]}"
puts "# Xbox One Rep: #{@Xbox["meta"]["xboxOneRep"]}"
puts "# Preferred color: #{@Xbox["meta"]["preferredColor"]}"
puts "# Real name: #{@Xbox["meta"]["realName"]}"
puts "# Bio: #{@Xbox["meta"]["bio"]}"
puts "# Tenure level: #{@Xbox["meta"]["tenureLevel"]}"
puts "# Watermarks: #{@Xbox["meta"]["watermarks"]}"
puts "# Location: #{@Xbox["meta"]["location"]}"
puts "# Show user as avatar: #{@Xbox["meta"]["showUserAsAvatar"]}"
rescue StandardError => e
puts "#{e}"
end
3. License
This library is published under the Apache 2.0 license.