1.1.1 • Published 4 years ago

profiles.js v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

profiles.js

RESTful Node.js API Wrapper to interact with the WebProfiles API

Usage

Add the package

To start, you will need to install the package. To do that, simply run npm i profiles.js. In your code, add the following:

const Profiles = require("profiles.js");
const profiles = new Profiles({
  api_key: "your-user-key-here",
});

To fetch your user token, run the following in the browser console:

const value = `; ${document.cookie}`;
const parts = value.split(`; pass=`);
if (parts.length === 2) parts.pop().split(";").shift();

Now you can use any of the functions below!


GET WebProfiles Statistics

profiles.stats().then((result) => console.log(result));

GET User Information

profiles.fetchUser(id, type).then((result) => console.log(result));

id is the user id/username, type is the type of id provided (id or username).

GET Search Results

profiles.search(query).then((result) => console.log(result));

query is the text to search for.

GET User Token Data

profiles.validateToken(token).then((result) => console.log(result));

token is the token to validate.

Editing a Profile

PUT Edit Bio

profiles.editBio(bio).then((result) => console.log(result));

bio is the new bio to set.

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago