Mine looks better
Yes it is wrong. just use Json_decode() function and it should give you a easy to use array.Arnold0 wrote:
Is that wrong ? Is JSON faster / Easyer to use ?
This is easy, just do this:YunoFanatic wrote:
i want to but im wondering or this is curiosity how can i click the picture then an website will come out many of player have that for example deni has a banner ''Mapper Help Team'' and when ever i click i always go to the mapper help team thread pls answer btw i like that mind creating me some?
[url=yoururlhere][img]yourimagelink[/img][/url]
Oh wow lol. "A JSON list containing user information" on the GitHub wiki should have given you a clue thoughArnold0 wrote:
...
string '[{"user_id":"1428609","username":"Arnold0","count300":"1953","count100":"318","count50":"2933","playcount":"11","ranked_score":"1412132","total_score":"2437922","pp_rank":"276967","level":"7.29994","pp_raw":"9.05734","accuracy":"98.76","country":"FR"}]' (length=252)
array (size=1)
0 =>
array (size=13)
'user_id' => string '1428609' (length=7)
'username' => string 'Arnold0' (length=7)
'count300' => string '1953' (length=4)
'count100' => string '318' (length=3)
'count50' => string '2933' (length=4)
'playcount' => string '11' (length=2)
'ranked_score' => string '1412132' (length=7)
'total_score' => string '2437922' (length=7)
'pp_rank' => string '276967' (length=6)
'level' => string '7.29994' (length=7)
'pp_raw' => string '9.05734' (length=7)
'accuracy' => string '98.76' (length=5)
'country' => string 'FR' (length=2)
iirc PHP or MySQL does that automatically.Arnold0 wrote:
I didn't know that osu!api delete the last 2 (or 4 in case of 100%) useless digit of accuracy.
Oh dear... Use cURL at least. file_get_contents is really slow and it should be used if your host doesn't have cURL installed.Arnold0 wrote:
$osu=file_get_contents("http://osu.ppy.sh/api/get_user?k=MYKEY&u=$id&m=$g");
function get_url($url) {
global $appName, $appURL, $appVersion, $appEmail;
// Do we have cURL installed?
if (function_exists('curl_init')) {
// Yes, do our magic.
$ch = curl_init();
$options = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_HTTPHEADER => array('Content-type: application/json') ,
CURLOPT_USERAGENT => $appName . '/' . $appVersion . ' (' . $appURL . '; ' . $appEmail . ') osu!APIlib (https://github.com/Repflez/osu-API-lib)',
);
curl_setopt_array( $ch, $options );
$content = curl_exec($ch);
curl_close($ch);
} else {
// No, use the slower file_get_contents.
$content = file_get_contents($url);
}
return $content;
}
Wait, what? No offense but what made you think that manipulating directly the string was a good idea? I would explain json_decode but XPJ38 did it first.Arnold0 wrote:
$pos=strpos($rankedscore,'","');
$rankedscore=substr($rankedscore,15,($pos-15));
Because I did have played osu!mania, but didn't complete the whole song because I kept on failing to get SS.Arnold0 wrote:
PS Winshley why you are level 28 mania with 0 score, 0% accuracy ?!?
Because of this:Arnold0 wrote:
PS Winshley why you are level 28 mania with 0 score, 0% accuracy ?!?
'total_score' => string '144063600' (length=9)(level is based on total score)
or just add 1px black border to letters/numbersAlexSant wrote:
can you use a different font color, in some bars the white in background make it hard to read.
{"user_id":"304520","username":"Piotrekol",........,"level":"100.864".............}
Do you really need the source code of this? Come on, you can make something similiar in one or two days of coding in php. It's pretty simple from what I can see.-Troke- wrote:
source please?
thank you, i am make this for private not publicTheHowl wrote:
Here's something similiar for you: https://bitbucket.org/TheHowl/osuuserbarclone/src
Please note: this isn't meant to be used publicily, since at the moment makes an API request every time the image is loaded and that bursts up fast the API requests. Use this only as reference.
As I said, I took even less than 2 days. It isn't a full clone, but still it works with a few edits. Time to do it: 4 hours.
EDIT: Change the value of the api key in the config.php file since it won't work without that changed!
Not really. Images are updated on i.ppy.sh every time they're loaded, it's a proxy, and if the server responses a 404 message, then the latest cache is displayed. Or at least, I think that it should be like that.marcostudios wrote:
But now there is the i.ppy.sh image thing that blocks the image from updating :c
Actually no. i.ppy.sh follows cache headers so if an image has the headers to not cache it, the image should not be cached. I tried it and it works (See my userpage and view the last 2 images at bottom, then refresh and view them again).Howl wrote:
Not really. Images are updated on i.ppy.sh every time they're loaded, it's a proxy, and if the server responses a 404 message, then the latest cache is displayed. Or at least, I think that it should be like that.marcostudios wrote:
But now there is the i.ppy.sh image thing that blocks the image from updating :c
Cool.Repflez wrote:
Actually no. i.ppy.sh follows cache headers so if an image has the headers to not cache it, the image should not be cached. I tried it and it works (See my userpage and view the last 2 images at bottom, then refresh and view them again).
Why in a PM and not publicly so everyone knows a bit more?Howl wrote:
Cool.Repflez wrote:
Actually no. i.ppy.sh follows cache headers so if an image has the headers to not cache it, the image should not be cached. I tried it and it works (See my userpage and view the last 2 images at bottom, then refresh and view them again).SPOILERNow tell me in forum PM what to write in the header to avoid caching >___>
Repflez wrote:
lolHowl wrote:
Now tell me in forum PM what to write in the header to avoid caching >___>
Just add this before sending the image.header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
Because is a rather bad idea to bypass the cache unless the image is in "real time". For things like userbars and such, one can use the i.ppy.sh cache to not redo the image at every request except at every N hours. And is not like you could search for [google:1337]php no cache header[/google:1337] or something like that.Avail wrote:
-snip-
Why in a PM and not publicly so everyone knows a bit more?
I'm a lazy bum though :^)Repflez wrote:
Because is a rather bad idea to bypass the cache unless the image is in "real time". For things like userbars and such, one can use the i.ppy.sh cache to not redo the image at every request except at every N hours. And is not like you could search for [google:1337]php no cache header[/google:1337] or something like that.Avail wrote:
-snip-
Why in a PM and not publicly so everyone knows a bit more?