[DEPRECIATED] ?????????? ??????, ??? ?? ???? ????????. This is the single most extensive Replit package, allowing you to access various parts of the site with just a few classes and methods. Maintained by @RayhanADev.
⚠️ IMPORTANT: This project has been depreciated. Read more here ⚠️
A Simple and Complete Replit API Package
Explore the docs »
View Package on NPM
·
Report Bug
·
Request Feature
The Replit GraphQL API is an extraordinary way to make projects unique and special, yet with the numerous packages available few such projects have been made. Why would that be? Most likely due to how complicated writing code can get and the limitations of their queries. My package, ReplAPI.it, changes that with a simple to use structure and many queries, some of which are:
My package is also simple to use with it's class-based structure. Simply create a new class for your User, Post, or whatever your heart desires and use built in functions with options to query data your way.
I suggest requiring the ReplAPI.it module until ES imports in NodeJS are stabilized.
If you have not already download npm:
npm install npm@latest -g
$ npm install replapi-it
import ReplAPI from 'replapi-it';
const replapi = ReplAPI({
username: 'your-username-here'
});
Using ReplAPI.it is very simple! Let's create a simple user and ask for their cycles:
import ReplAPI from 'replapi-it';
const replapi = ReplAPI({
username: 'your-username-here'
});
const myUser = new replapi.User("RayhanADev");
async function getCycles() {
let info = await myUser.userGraphQLDataFull();
let cycles = info.karma; // Yep, it's karma!
console.log(`User Cycles: ${cycles}`)
}
getCycles()
Output:
User Cycles: 1008
That was fun! Now how about getting a specific post? Let's create a simple post and ask for it's title:
import ReplAPI from 'replapi-it';
const replapi = ReplAPI({
username: 'your-username-here'
});
const myPost = new replapi.Post(78043);
async function getTitle() {
let info = await myPost.postDataFull();
let title = info.title;
console.log(`Post Title: ${title}`)
}
getTitle()
Output:
Post Title: Presenting... ? RayhanADev ?? (GraphQL Success!)
For more examples, please refer to the Documentation
See the open issues for a list of proposed features (and known issues).
I'm considering adding in support for Crosis communications after they distribute developer keys again. Right now I'm experimenting with WSS and eval.repl.it for code execution!
Contributions are much appreciated, and if you have a cool idea that feels right in this package then you should check out our contributing page.
Distributed under the GPL-3.0 License. See LICENSE
for more information.
RayhanADev - @RayhanADev - [email protected]
Project Link: https://github.com/ReplAPI-it/ReplAPI.it-NodeJS