View Full Version : Is there a JSON api that returns all levels and level details for a specific level?
Darkhog
Nov 30, 2017, 03:09 PM
I want to make a launcher/level manager with an option to download and unpack levels automatically so people won't need to waste their time with unzipping them manually or (in the case of people who play/review a lot of levels) shufling levels around because home cooked levels list got full again.
Violet CLM
Nov 30, 2017, 03:52 PM
(Unrelated to your main question, but I wanted to say that the home cooked levels list does not have a length limit in JJ2+.)
Darkhog
Nov 30, 2017, 03:58 PM
(good to know, however there are people playing on vanilla who have to deal with it)
Stijn
Nov 30, 2017, 05:31 PM
Here's a PHP file that does what you want as far as the "level details for a specific level" part is concerned. I ripped it from Jazz2Online's source code and it's eight years old so it may have some ideosyncracies and leftover functionality you don't need, but it works and you should be able to adapt it for your needs, or port it to a language you're comfortable with.
https://gist.github.com/stijnstijn/d9caff3373dc61e21b5e9ed29d68ceb1
EDIT: Oh, you mean for J2O? No, there's no such thing, but it's not a bad idea. I might add something like that at some point.
Darkhog
Nov 30, 2017, 06:38 PM
Yeah, all I really need is some PHP file that spits the same info as level listings/level pages (so 2 files, actually), but as a plain JSON so I can then parse it and show in a launcher that allows for automatic level downloads. You'd still need to go to J2O to upload/rate levels, but it would make easier to just download levels themselves and then play them as you'd be able to launch Jazz 2 directly from manager/downloader. But for that I need that API. I could write something that would scrub info from HTML, but it would break on every site change and it would be a messy code anyway.
vBulletin® v3.8.2, Copyright ©2000-2025, Jelsoft Enterprises Ltd.