1.0.3 • Published 4 years ago

happy-wheels v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Classes

HappyWheels

The main class. Used to interact with the api.

HappyWheels.searchLevels(query, options) ⇒ Promise.<Array.<Level>>

Searches levels in happy wheels

ParamTypeDescription
queryStringquery
?optionsObjectoptions

HappyWheels.getFeatured(options) ⇒ Promise.<Array.<Level>>

Gets happy wheels featured levels

ParamTypeDescription
?optionsObjectoptions

HappyWheels.getLevel(id) ⇒ Promise.<Level>

Gets happy wheels level

ParamTypeDescription
idStringlevel id

HappyWheels.getReplay(id) ⇒ Promise.<Replay>

Gets happy wheels replay

ParamTypeDescription
idStringreplay id

HappyWheels.getUser(id) ⇒ Promise.<User>

Gets happy wheels user

ParamTypeDescription
idStringuser id

Level

Represents a level on happy wheels.

new Level(data)

ParamTypeDescription
dataObjectparsed XML data

level.name : String

The name of the level

level.id : String

The id of the level

level.description : String

The description of the level

level.character : String

The character of the level

level.createdAt : Date

The creation date of the level

level.author : User

The author of the level

level.playCount : Number

The play count of the level

level.votes : Number

The votes of the level

level.weightedRating : Number

The weighted rating of the level

level.url : String

The level URL.

Read only: true

level.averageRating : Number

The average rating of the level.

Read only: true

level.getReplays(sortBy) ⇒ Promise.<Array.<Replay>>

Gets all replays from the level.

ParamTypeDefaultDescription
sortByStringcompletion_timesort by

Replay

Represents a replay on happy wheels.

new Replay(data)

ParamTypeDescription
dataObjectparsed XML data

replay.levelID : String

The ID of the replays level

replay.level : Object

The level of the replay

replay.id : String

The ID of the replay

replay.description : String

The description of the replay

replay.character : String

The character used in the replay

replay.createdAt : Date

The creation date of the replay

replay.author : User

The author of the replay

replay.votes : Number

The votes of the replay

replay.weightedRating : Number

The weighted rating of the replay

replay.url : String

The replay URL.

Read only: true

replay.averageRating : Number

The average rating of the replay.

Read only: true

replay.getLevel() ⇒ Promise.<Level>

Gets the level of the replay.

User

Represents a user on happy wheels.

new User(id)

ParamTypeDescription
idobjectparsed XML data

user.username : String

The username of the user

user.id : String

The ID of the user

user.profileURL : String

The profile URL.

Read only: true

user.getLevels() ⇒ Promise.<Array.<Level>>

Gets all levels created by this user.

user.getProfile() ⇒ Promise.<User>

Fetches the user's profile on totaljerkface.com and applies it to itself.

Options

{
   searchBy: 'name|user',
   sortBy: 'newest|oldest|plays|rating',
   uploaded: 'today|week|month|anytime',
   query: 'any',
   limit: 50,
   levelID: 'id',
   userID: 'id',
   replayID: 'id'
}

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago