Skip to content

Commit

Permalink
UPD: Added GetLeaderboardsForCharacter
Browse files Browse the repository at this point in the history
  • Loading branch information
FraWolf committed Jul 30, 2021
1 parent a39a5d3 commit 285443d
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 6 deletions.
62 changes: 60 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
# QURIA
# Quria

### NodeJS Destiny 2 API Wrapper
A simple Destiny 2 API Wrapper made with Node.js.
<br />

### Installation

**Node.js 14.0.0 or newer is required.**

```sh-session
npm install quria
```

or

```sh-session
yarn add quria
```

### Example usage

```js
const QuriaAPI = require("quria");
const quria = new QuriaAPI({
API_KEY: "your-api-key-here",
});

quria
.GetDestinyManifest()
.then((res) => {
console.log(res.data.Response);
})
.catch((error) => {
console.log(error.response.data);
});
```

### Documentation

You can use the [Bungie API Docs](bungie-net.github.io/multi/) as **Quria Documentation** because all of it's methods are the same as the docs says.

### Links

- [Bungie API Docs](https://bungie-net.github.io/multi/)
- [GitHub](https://github.com/FraWolf/quria/)
- [NPM](https://www.npmjs.com/package/quria)

### Projects that uses Quria

Currently no projects uses Quria because it's still in development phase. If you would to include your project here, open an issues with the name, repository/website and a small description.

### To do:

- [ ] OAuth2 Integration
- [ ] Better request function (to avoid api url repeating every time)
- [ ] Finishing authentication required function
- [ ] Typescript rewrite (maybe using DIM's api types)

### Contributing

If you would contribute to this project, just fork the repository and then send a pull request. We will validate your request and, if it's valid, we will commit into the main branch.
13 changes: 12 additions & 1 deletion lib/bungie.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,18 @@ module.exports = class Quria {
return request(requestURL, "GET", this.config.headers);
}

GetLeaderboardsForCharacter() {}
GetLeaderboardsForCharacter(
membershipType,
destinyMembershipId,
characterId,
queryString = { maxtop: null, modes: null, statid: null }
) {
const requestURL = formatQueryStrings(
`${this.config.urls.api}/Destiny2/Stats/Leaderboards/${membershipType}/${destinyMembershipId}/${characterId}/`,
queryString
);
return request(requestURL, "GET", this.config.headers);
}

SearchDestinyEntities() {}

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "quria",
"version": "1.0.2",
"description": "NodeJS library wrapper for BungieNET Destiny API",
"version": "1.0.3",
"description": "A simple Destiny 2 API Wrapper made with Node.js.",
"main": "index.js",
"scripts": {
"test": "node test/index"
Expand All @@ -18,7 +18,7 @@
"Bungie"
],
"author": "Francesco Lombardo <frawolf@outlook.it>",
"license": "ISC",
"license": "MIT",
"bugs": {
"url": "https://github.com/FraWolf/quria/issues"
},
Expand Down

0 comments on commit 285443d

Please sign in to comment.