rippleapi
v1.1.0
Published
An easy to use wrapper for the Ripple osu! private server API
Downloads
20
Maintainers
Readme
RippleAPI
RippleAPI is an easy to use JavaScript wrapper for the Ripple API.🎵 I make requests to the Ripple API practically every single day for a various amount of projects, and it was honestly a pain to have to rewrite the same code a billion times. Thus, I've created a library, for myself and others to use.
Usage
It's extremely simple to start using RippleAPI.js just by following the steps below.
- Run
npm install rippleapi --save
All functions follow the same format listed below. It should be fairly easy to use.
const rippleAPI = require('rippleapi');
rippleAPI.ping()
.then((response) => {
console.log(response);
})
.catch((err) => {
throw new Error(err);
});
List of Functions
There's a ton of different endpoints on the Ripple API that is currently supported. Here are the following:
Misc
- ping(token) - Check the API is alive, and check your token’s (not required) privileges.
- surprise() - A test API endpoint that spits some random sentences.
Badges
- getBadges() - Retrieve a list of all the current badges on Ripple.
Leaderboard
Note: For mode parameters you can specify either: 'mania', 'osu', 'taiko', 'ctb' OR 'all'
- getLeaderboard(mode, page) - Retrieve a list of all the current leaderboard on Ripple.
Tokens
- createToken(username, password, privileges, description) - Create a new token using username and password.
- getTokens(token) - Allows to retrieve information about the API tokens of the current user.
- getTokenInfo(token) - Retrieves information about the passed token.
Users
The following can be used to retrieve only one user:
- getUserById(userId) - Retrieves information about one user by their user Id.
- getUserByName(username) - Retrieves information about one user by their username.
- getFullUserById(id) - Retrieves Full information about one user by their user id.
- getFullUserByName(username) - Retrieves Full information about one user by their username.
- getIdOfUser(username) - Retrieves an ID of an user, knowing their username. Simple as that.
- getUserpageById(id) - Retrieve the userpage of an user, in BBCode.
- lookupUser(partOfUsername) - Search for an user knowing (part of) their username. This is mainly used for Ripple’s user search function, in the navbar.
The following can be used to retrieve one or more users:
- getUserByNameAka(nameAka, page) - Retrieves a list of users by their name_aka.
- getUsersByCountry(country, page) - Retrieves a list of users by their country.
- getUsersByPrivilegeGroup(privilegeGroup, page) - Retrieves a list of users by their Privilege Group.
- getUsersById([userIds]) - Retrieves a list of users by their ids.
- getUsersByName([usernames]) - Retrieves a list of users by their usernames.
- getUsersByNameAka([nameAkas]) - Retrieves a list of users by querying for multiple name_akas.
- getUsersByCountries([countries]) - Retrieves a list of users by querying for multiple countries.
Scores
Note: for mode parameters, you can specify either "osu", "taiko", "mania", "ctb", or "all"
- getBeatmapScores(beatmapMd5 OR beatmapId, mode) - Retrieves scores for a certain beatmap.
- getUserBest(username OR userId, mode) - Retrieves a user's best scores.
- getUserRecent(username OR userId, mode) - Retrieves a user's recent scores.
Cheesegull
Note: For gameMode parameters, you can specify either:
A single mode string: 'mania', 'osu', 'taiko' 'ctb', 'all'
OR
An array of modes: ['mania', 'osu', 'taiko', 'ctb', 'all']
Note: For rankedStatus parameters, you can specify either:
A single status string: 'ranked', 'unranked', 'loved', 'graveyard', 'wip', 'pending', 'approved', 'qualified', 'all'
OR
An array of statuses: ['ranked', 'unranked', 'loved', 'graveyard', 'wip', 'pending', 'approved', 'qualified', 'all']
- getBeatmapInfo(beatmapId) - Retrieves information about a beatmap with the given ID.
- getBeatmapSetInfo(beatmapSetId) - Retrieve information about a beatmapset, as well as its children, knowing its ID.
- searchBeatmaps(searchQuery, gameMode, rankedStatus, amount, offset) - Returns beatmaps based on the searched query and details passed.
Checklist
For the most part, everything useful is done. Here's a list of things that aren't done.
- WebSocket API [✗]
- Documentation [✗]
- Blog [✗]
- Requests that require a security key [✗]
LICENSE
MIT License
Copyright (c) 2017 Swan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.