npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sporepedia

v1.0.1

Published

Access the Sporepedia API in your node app. Derived from the official Spore REST API (http://www.spore.com/comm/developer/samples/).

Downloads

9

Readme

sporepedia.js

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

| Param | Type | Description | | --- | --- | --- | | assetID | String | The 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

| Param | Type | | --- | --- | | username | String |

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

| Param | Type | Default | Description | | --- | --- | --- | --- | | username | String | | | | [startIndex] | Number | 0 | The start index - i.e if it was 5 the first 5 assets would be skipped | | [length] | Number | 100 | The 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

| Param | Type | | --- | --- | | 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | username | String | | | | [startIndex] | Number | 0 | The start index - i.e if it was 5 the first 5 achievements would be skipped | | [length] | Number | 100 | The 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

| Param | Type | Description | | --- | --- | --- | | username | String | | | startIndex | Number | The start index - i.e if it was 5 the first 5 buddies would be skipped | | length | Number | The 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

| Param | Type | Description | | --- | --- | --- | | username | String | | | startIndex | Number | The start index - i.e if it was 5 the first 5 subscribers would be skipped | | length | Number | The 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | sporecastID | * | | ID of sporecast | | [startIndex] | Number | 0 | The start index - i.e if it was 5 the first 5 sporecasts would be skipped | | [length] | Number | 100 | The 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

| Param | Type | | --- | --- | | 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | assetID | * | | | | [startIndex] | Number | 0 | The start index - i.e if it was 5 the first 5 comments would be skipped | | [length] | Number | 100 | The 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

| Param | Type | Description | | --- | --- | --- | | 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 |
| assetID | String | |

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

| Param | Type | | --- | --- | | achievementID | * |

search(viewType, startIndex, length) ⇒ String

List creations for a given view

Kind: global function

| Param | Type | Description | | --- | --- | --- | | 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