Newgrounds

Newgrounds

Newgrounds API wrapper object

Constructor

# new Newgrounds(app_id, cipheropt)

Create a newgrounds object
Parameters:
Name Type Attributes Description
app_id Number The newgrounds App ID
cipher String <optional>
The encryption Key (AES-128/Base64)

Methods

# call(component, parametersopt, asyncopt) → {Object}

Send a message to call a component of the Newgrounds API
Parameters:
Name Type Attributes Default Description
component String Name of the component
parameters Object <optional>
0 Parameters to use for call
async Boolean <optional>
0 If true, wait for response before continuing (will cause stall)
Returns:
- The response JSON object
Type
Object

# getScores(id, useropt, socialopt, skipopt, limitopt) → {Object}

Get scores from a scoreboard
Parameters:
Name Type Attributes Default Description
id Number The scoreboard id
user String <optional>
0 A user's id or name
social Number <optional>
0 If true, only social scores will be loaded
skip Number <optional>
0 Number of scores to skip before start
limit Number <optional>
10 Number of scores to include in the list
Returns:
- The response JSON object
Type
Object

# logView()

Send message to log a view

# postScore(id, value)

Send message to post score
Parameters:
Name Type Description
id Number The scoreboard id
value Number The score value

# unlockMedal(id)

Send message to unlock a medal by id
Parameters:
Name Type Description
id Number The medal id