Idea: Store number of remixes in .env

There might be more endpoints to the API which might have all these info. Only if they documented the API and officialy released it, now that the ToS contains information regarding the API. Also, some info might need authentication and some might requests like POST and PATCH.

1 Like

@khalby786 perhaps there could be a wayā€¦ Like remixing through the actual project site sends a request to a dashboard which holds the counter

@random when a project is remixed, two POST requests are made:
https://api.glitch.com/projects/PROJECT_ID/edited
https://api.glitch.com/v1/projects/by/domain/PROJECT_NAME

Maybe we can count how many times the requests are made

How do you that? Considering the fact that Glitch API is not oursā€¦

1 Like

Noā€¦ But there are packages

What are they? Iā€™m very interested in finding a way to get remixesā€¦

If only Team Analytics still existed.

1 Like

Okay, Iā€™m gonna ask Glitch Staff if an endpoint exists: @glitch_support.

2 Likes

I think @jarvis394 had oneā€¦

Would there be a way to manually tell, like some kind of external console.log(window.location.hostname)?

The NPM package doesnā€™t have itā€¦

There is a env variable for project ids of remixes (if It is useful for at all for you) it is called PROJECT_REMIX_CHAIN which has something like this for example [b952187a-ea2e-4a1c-9055-f455c996a381,0a59806f-5c0d-468e-84bb-fa5b54ecf500,929980a8-32fc-4ae7-a66f-dddb3ae4912c] and is something currently being documentated over here https://github.com/youngchief-btw/Glitch-Docs

1 Like

Thanks for all the info @youngchief!

Thatā€™s nice to know, but how would i convert the string into number of remixes?

@youngchief, I donā€™t think that solves the issue because as @FlantasticDan said, it only shows the projects which make up the current project. And in all cases (except GitHub import projects, Iā€™m not sure) it is one of the three projects or sometimes all three of them, named static-start, hello-express and hello-webpage. See Idea: Store number of remixes in .env and Idea: Store number of remixes in .env

1 Like

I believe you could do something like this, but I havenā€™t tried it before. Iā€™m just assuming this is how the remix chain works:

let remixes = process.env.PROJECT_REMIX_CHAIN
remixes = remixes.replace("[", "").replace("]", "")
let remixarray = remixes.split(",")
let number = remixarray.length

Or a one-liner function:

const getRemixes = () => (process.env.PROJECT_REMIX_CHAIN || "").match(/[0-9-a-f\-]+/gi) || [];

Usage:

getRemixes()
// [
//   "b952187a-ea2e-4a1c-9055-f455c996a381",
//   "0a59806f-5c0d-468e-84bb-fa5b54ecf500",
//   "929980a8-32fc-4ae7-a66f-dddb3ae4912c"
// ]

I knew that used to be a checkbox! When did they remove it?

1 Like

Iā€™ve been on glitch for 7 months and I canā€™t remember ever seeing it.

Iā€™ve been on it since October 2019 and havenā€™t seen it.

Thats when I joined too!