@devchromium/wynnjs
Wynncraft API Javascript wrappepr
Last updated a year ago by devchromium .
MIT · Original npm · Tarball · package.json
$ cnpm install @devchromium/wynnjs 
SYNC missed versions from official npm registry.

WynnJS

A JavaScript wrapper for the official Wynncraft API, if you wish you may contribute to the wrapper. This wrapper is a modification of https://github.com/FraWolf/wynncraft.js, all rights of the fetchPlayer and fetchItem goes to the author of wynncraft.js.

Introduction

You only have a limited amount of API Calls per a certain period of time, this can differ per API endpoint. Please read more on the official documentation of the API. https://docs.wynncraft.com/

Table of Contents

Installation via Node Package Manager

To get the latest version of WynnJS please use the following command in a command prompt.

npm i --save @devchromium/wynnjs@latest

Usage

Initialization

const wynnJS = require("@devchromium/wynnjs");
const wynn = new WynnJS();

Legacy

fetchItem

This will return the item object from the item name you input.

let item = // code to get itemname
wynn.fetchItem(item)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchGuild

This will return the guild object from the guild name you input (This does not work with guild prefixes).

let guild = // code to get guild
wynn.fetchGuild(guild)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchServers

This will return all servers on the network.

wynn.fetchServers()
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchTerritories

This will return all the territories.

wynn.fetchTerritories()
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchGuildLeaderboard

This will return the top 100 guilds. Definiton of timeframe: this can be alltime

wynn.fetchGuildLeaderboard(timeframe)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchPlayerLeaderboard

This will return the top 100 guilds. Definiton of timeframe: this can be alltime

wynn.fetchPlayerLeaderboard(timeframe)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchPvPLeaderboard

This will return the top 100 guilds. Definiton of timeframe: this can be alltime

wynn.fetchPvPLeaderboard(timeframe)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

search

This will return a list of guild and player names which contain the search query, this is case-insensitive.

wynn.search(name)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

Version2

fetchPlayer

This will return the player object from the username you input.

let username = // code to get username
wynn.fetchPlayer(username)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

fetchIngredient

This will return the ingredient object from the ingredient name you input.

let ingredient = // code to get ingredient
wynn.fetchIngredient(ingredient)
.then(res => {
    // Code to display result
})
.catch(err => {
    console.log(err);
});

Current Tags

  • 1.1.1                                ...           latest (a year ago)

7 Versions

  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 7
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |