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

iwm-api

v1.0.0

Published

Interact with the I Wanna Maker API

Downloads

3

Readme

iwm-api

A package to interact with the I Wanna Maker API npm install iwm-api This is not finished, so please contribute what you can!

Starting off

Most client functions don't need you to be logged in, but here's how to do so. You need a username, password and the current version of IWM (be sure to update it often)

var client = new require("iwm-api").client();

client.login("username","password","version").then(async function(session) {
    console.log(session)
}).catch(function(err) {
    console.log(err)
})

Leaderboards

// Global leaderboard (yes its a fake enum I know)
console.log(await client.leaderboard(client.enum.leaderboardCodes["Skribble Hard"]))
// Leaderboard for a level
console.log(await client.leaderboardLevel(4269,5,0))
// Level ID, limit, and if we should include the replay data (0 for no, 1 for yes)

Level search

// By ID
console.log(await client.search({
    "code": "AAAABBBB"
}))

// By whatever else

console.log(await client.search({
    "min_diff": "0", // 0 for easy, 5.00 for impossible
    "order": `[{${encodeURIComponent(`"Dir": "desc", "Name": "created_at"`)}}]`, // I don't know too much about this, but you can change the "Sort by"
    "required_tags": `6,2`, // Tags by ID
    "start": "0",
    "limit": "10",
    "max_diff": "5.00"
}))

// Feel free to mix in any further parameters you can find in the search GET request
// http://make.fangam.es/api/v1/map?author=Mr.%20Maker&min_diff=0&order=[{%20"Dir":%20"desc",%20"Name":%20"created_at"%20}]&record=0&start=0&required_tags=5&limit=10&max_diff=5.00&played=1&name=levelName&clear=0

Levels

// Both of these require you to be logged in

await client.playLevel(4269) // Level ID
// Gives you level data (you can't ACTUALLY play it)

await client.tagLevel(420,[6,9]) // Tag a level with tag ids

await client.rateLevel(420,5) // Rate a level (level ID then 1 for down and 5 for up)

Users

// User lookup
await client.userLookup(4269) // User ID

// Update avatar and country (login required)
await client.updateLook({
    "Country": 10, "PantsColor": 12058802, "HatSpr": 0, "HairColor": 0, "CapeColor": 0, "ShoesColor": 16777215, "ID": 212176, "ShirtColor": 12124343, "SkinColor": 16748460
}) // Don't ask me what all those mean. Can somebody contribute to this README and make it better to understand?

// Follow/unfollow (login required)
await client.updateFollow(4269,true) // User ID, follow/unfollow

Notifications

// Get unread notification count
console.log(await client.notificationsUnread())

// Get notifications
console.log(await client.notifications(0,10)) // Start and limit

Misc

await client.canUpload() // true or false, because cooldown
await client.mapCount() // Global map count
client.logout() // Logout

Contributing

Please contribute (: Thats all