phpsu! - a simple script to fetch user data from the API
Introduction
phpsu! is a simple (and short) php-script, serving the user with variables to display stats from the osu!API. I made it, because I had nothing to do, and I know some people who still use(d) explode(); to fetch the userdata from the sorta-styleless profile page and since it's only a set of variables it's very simple to use for beginners (or lazy people).NOTICE: Badly written, but it works!
Usage
Set up the config
- $key: Insert your osu!API-key, generate one here!
- $mode: Select your playmode: 0 = osu!, 1 = Taiko, 2 = CtB, 3 = osu!mania
- $user -> $type: Insert the username or ID of the player, if you use the username use string, id if you use the user-id, in $type
- $mode: Select your playmode: 0 = osu!, 1 = Taiko, 2 = CtB, 3 = osu!mania
- $user -> $type: Insert the username or ID of the player, if you use the username use string, id if you use the user-id, in $type
Set up up your site to show the stats
just
include 'osu.conf.php';
Variables you can use
On the page with the included file, just write your text/code and add the following values:
$user_id - the User ID
$user_name - the Username
$user_level - Level
$user_accuracy - Accuracy
$country - Country (as ISO3166-1 alpha-2 country code)
$playcount - your Playcount
$score_ranked - Ranked Score
$score_total - Total Score
$pp_rank - Your PP-Rank
$pp_raw - PP-Count
$rank_ss - Count of SS Ranks
$rank_s - Count of S Ranks
$rank_a - Count of A Ranks
$user_id - the User ID
$user_name - the Username
$user_level - Level
$user_accuracy - Accuracy
$country - Country (as ISO3166-1 alpha-2 country code)
$playcount - your Playcount
$score_ranked - Ranked Score
$score_total - Total Score
$pp_rank - Your PP-Rank
$pp_raw - PP-Count
$rank_ss - Count of SS Ranks
$rank_s - Count of S Ranks
$rank_a - Count of A Ranks