Describe your feature request
I would like to be able to access my own repl, assuming I know their names and the names of the files within. I would like to be able to use my own repl to do this via a standard REST API.
What problem(s) would this feature solve?
This feature would allow me to
(1) inspect 100’s or 1000’s of repls to find problems that crop up when REPLIT makes changes that impair operation of previously working repls.
(2) as a teacher download and compare any repl files to help eliminate duplicates, and search for similarities between repls (through my own algorithms).
Explain what you were trying to do when you came across the problem leading to this feature request
Many replit system-wide changes require me to “just edit xxxyyzz file” to change something. Also, I often want to compare different repls to see how similar they are algorithmically. There is no way to do that currently that I know of.
Certainly this feature could be expanded (look at Instructure’s Canvas for example) to support a platform-wide rest api that lets me get and set certain items.
This request minimally is just to allow me to see my own data. It could be expanded to allow me to see other public data, but all I really care about is my own data.
To be clear, I’m also not asking replit to allow me to “query for valid repl names”… I’m assuming I’ll know the names of the repls I want to change. (but the former would be nice as well).
Just to be clear, this is not a request for public API.
From looking at the old docs, it also does not appear that those older solutions ever enabled this specific feature request… as best as I can tell, the prior efforts allowed execution of code, but did not enable access to my own repl content.
A simpler solution (sans api) to this request would be to simply support the # fragment tag in a URL for files that I own. Replit does not currently support that.
Indeed it does.
If you can write a program in python for example that programmatically “scrapes” that main.py using a curl command, that would be an example of a potential solution. Historically replit has prevented that for public repls and for private repls. Having the ability to inspect ones own repls programmatically (extract the data, not just redirect the browser) is the request. Please feel free to share a repl that does this in any language if you have a working solution - that would be very appreciated.
If you read Replit’s Terms of Service, section 4 point 14, this would fall under account automation and is not allowed. But if you understand the consequences and still want to do it, I’ve made a library you could use called Crosis, made in JavaScript. For example:
import { Crosis, adapterReplit } from "crosis";
// Connect to your Repl
const crosis = new Crosis({
adapter: adapterReplit({
replId: YOUR_REPL_ID,
// replace this with your Repl's ID
// you can get your Repl ID by going into the shell
// and running `echo $REPL_ID`
sid: YOUR_REPLIT_SID,
// replace this with your account's SID
// How to get your SID:
// https://replit.com/talk/learn/How-to-Get-Your-SID-Cookie/145979
}),
});
// Connect crosis
crosis.connect().then(async () => {
console.log("Crosis connected");
// Read a specific file
const myFile = await crosis.readFile("hello.txt");
console.log(myFile.toString());
// Cleanly close the connection
await crosis.disconnect();
});