Skip to content

kenwalker/jsork

Repository files navigation

jsork

(Pronounced J-Sork) JSON APIs to the Amtgard ORK

See the Github pages document as that is where more doc and examples will be added.

jsork Github Pages

This is work in progress so not all APIs have been implemented yet.

There's a requirement for jQuery to be present.

So at a minimum you need the Jsork APIs and jQuery loaded in your page as follows:

<script src="jquery.js"></script>
<script src="jsork.js"></script>

The APIs are grouped into categores like kingdom, park, player, etc. To use the API you get to it through the global jsork namespace.

All the API calls take whatever arguments are required and return a promise.

jsork.kingdom.getKingdoms().then(function(allKingdoms) {
    console.log("There are " + allKingdoms.length + " Kingdoms in Amtgard");
})

Would print out There are 25 Kingdoms in Amtgard

jsork.player.getInfo(43232).then(function(player) {
    console.log("Ken's persona is " + player.Persona);
})

Would print out Ken's persona is Kismet Shenchu

Some APIs have additional parameters like getting a players awards. You can ask for them all using jsork.awardIDs.ALL or like the following example just as for the one you want.

jsork.player.getAwards(43232, jsork.awardIDs.ORDER_OF_THE_SMITH).then(function(data) {
    console.log("Ken has " + data.length + " Orders of the Smith");}
);

Would print out Ken has 4 Orders of the Smith

Another example is to look for, say, a Knighting?

jsork.player.getAwards(43232, jsork.awardIDs.KNIGHT_OF_THE_FLAME).then(function(data) {
    console.log("Ken received his Flame belt on " + data[0].Date);}
);

Would print out Ken received his Flame belt on 2021-04-03

About

Json APIs to the ORK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published