1.0.1 • Published 1 year ago

sporepedia v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

sporepedia.js

npm.io

A JavaScript library for easy API access to the Sporepedia - the content library for the 2008 god game 'Spore' by Maxis. This is essentially a wrapper for the REST API provided by Spore.

Installation

With npm

$ npm install sporepedia.js
const spore = require("sporepedia");

import is not supported

Usage

When startIndex is referred to, this is how many assets are skipped when loading a list. In conjunction with length, this is for pagination.

For example, if startIndex is 0 and length is 100, it'll load the first 100 assets. If startIndex is then set to 100, it'll load the second 100, and so on.

Functions

stats() ⇒ String

Get daily stats about Spore.com

Kind: global function Returns: String - JavaScript object containing some stats

creatureStats(assetID) ⇒ String

Get various stats like height, diet, abilities etc. for a creature

Kind: global function Returns: JavaScript object containing creature stats

ParamTypeDescription
assetIDStringThe asset ID of the creature

user(username) ⇒ String

Get profile pic, tagline, user id and creation date

Kind: global function Returns: String - JavaScript object containg user data

ParamType
usernameString

userAssets(username, startIndex, length) ⇒ String

Get asset id, name, creation date, type, parent and rating for a list of assets created by a user

Kind: global function Returns: String - JavaScript object containing list of assets

ParamTypeDefaultDescription
usernameString
startIndexNumber0The start index - i.e if it was 5 the first 5 assets would be skipped
lengthNumber100The number of assets to fetch

userSporecasts(username) ⇒ String

Get id, name, tags, subscription count, rating etc. for Sporecasts subscribed to by a user

Kind: global function Returns: String - JavaScript object containing info for Sporecasts

ParamType
username*

userAchievements(username, startIndex, length) ⇒ String

Get number of achievements for user and a list of achievement ids and unlock-dates

Kind: global function Returns: String - JavaScript object containing list of achievements

ParamTypeDefaultDescription
usernameString
startIndexNumber0The start index - i.e if it was 5 the first 5 achievements would be skipped
lengthNumber100The number of achievements to fetch

userBuddies(username, startIndex, length) ⇒ String

For a given username, get a list of buddy names and ids and total buddy count

Kind: global function Returns: String - JavaScript object containing a list of buddies

ParamTypeDescription
usernameString
startIndexNumberThe start index - i.e if it was 5 the first 5 buddies would be skipped
lengthNumberThe number of buddies to fetch

userSubscribers(username, startIndex, length) ⇒ String

For a given username, get the list of users who have added that username as a buddy.

Kind: global function Returns: String - JavaScript object containing list of subscribers

ParamTypeDescription
usernameString
startIndexNumberThe start index - i.e if it was 5 the first 5 subscribers would be skipped
lengthNumberThe number of subscribers to fetch

sporecastAssets(sporecastID, startIndex, length) ⇒ String

Get asset id, and name for assets in a sporecast

Kind: global function Returns: String - JavaScript object containing info for assets

ParamTypeDefaultDescription
sporecastID*ID of sporecast
startIndexNumber0The start index - i.e if it was 5 the first 5 sporecasts would be skipped
lengthNumber100The number of sporecasts to fetch

asset(assetID) ⇒ String

For a given asset id, get name, description, tags, 10 latest comments, type, parent, rating, creation date and author name/id

Kind: global function Returns: String - JavaScript object containing info for an asset

ParamType
assetID*

assetComments(assetID, startIndex, length) ⇒ String

For a given asset id, get a list of comments, sender names and comment dates

Kind: global function Returns: String - JavaScript object containing list of comments

ParamTypeDefaultDescription
assetID*
startIndexNumber0The start index - i.e if it was 5 the first 5 comments would be skipped
lengthNumber100The number of comments to fetch

assetData(dataType, assetID) ⇒ String

Get XML and PNGs for an asset ID.

Kind: global function Returns: String - If dataType is 'model', returns an XML string with the model info. Otherwise returns the URL of the image

ParamTypeDescription
dataType'model' | 'image' | 'thumb''model' returns the XML for a spore model, 'thumb' returns the URL to a
smaller thumbnail of the asset, 'image' returns the URL to a full size image of the asset
assetIDString

achievementIcon(achievementID) ⇒ String

Get the official Spore achievement icon for a given achievement id

Kind: global function Returns: String - The URL of the achievement icon

ParamType
achievementID*

search(viewType, startIndex, length) ⇒ String

List creations for a given view

Kind: global function

ParamTypeDescription
viewType"TOP_RATED" | "TOP_RATED_NEW"
| "NEWEST" | "FEATURED" | "RANDOM" | "CUTE_AND_CREEPY"
startIndex*The start index - i.e if it was 5 the first 5 creations would be skipped
length*The number of creations to fetch

README generated with jsdoc-to-markdown

1.0.1

1 year ago

1.0.0

1 year ago