Skip to content
Sign upLog in
← Back to Community
thyncAPI: A theme sync API for you!
Profile icon
JBloves27

thyncAPI

The one and only thyncAPI. Used for thync projects

About

This was originally created just for the thync Bot, a discord bot that syncs with thync. However, I do think this could be more handy in other sub-projects, so I created this a bit more detailed and etc. Some of the code is used from Reflux, a project and module created by frissyn and CoolCoderSJ. However, this issue and suggestion came up, so I decided to create this. thync has also become sub-projects and a major project.

thync has not come out yet, this is just thyncAPI.

Using it

To use it, as of right now, you have to open up this, and then to use it in python, do the following:

import requests res = requests.get("https://thync-API.jbloves27.repl.co/toggle") data = res.text print(data)

OR

import requests res = requests.get("https://thync-API.jbloves27.repl.co/toggle") data = res.content print(data)

You can either print or return, depending on how you'll use it. Then copy the code, make a bookmark, and paste in the url/link. Then click the bookmark when you are on Replit. You're all set!

Suggestions and contribute

To leave suggestions, just leave a comment or a PR. To contribute, leave a PR or an issue to ask.

Conclusion

I hope you enjoy using this API! See you on the next (thync) post!

Voters
Profile icon
merryxmas2222
Profile icon
maxina
Profile icon
PixiGem
Profile icon
codingjlu
Profile icon
ch1ck3n
Profile icon
InvisibleOne
Profile icon
Gh0stHack3r
Profile icon
JBloves27
Comments
hotnewtop
Profile icon
ch1ck3n

what does this do

actually what does it do

the explanation isn't very cool

Profile icon
JBloves27

Uh, so its an api, meaning you can access it through requests *, get the light/dark mode sync code, bookmark it, and then use it.

*Note that it works with all websites

Sorry if it was unclear, ill try to fix the description asap. But yeah, i hope my explanation cleared things up

@ch1ck3n

Profile icon
ch1ck3n

@JBloves27
but this is just better javascript:(function() {document.body.className = "replit-ui-theme-root dark"})();

Profile icon
JBloves27

Does it work? With websites as well? Just checking :)

@ch1ck3n

Profile icon
ch1ck3n

@JBloves27
your thing only works with replit (I checked)

Profile icon
JBloves27

Yeah, but would that code work in Replit?

@ch1ck3n

Profile icon
ch1ck3n
Profile icon
JBloves27

Oh. I'll try that with other versions of thyncAPI, thanks :D

@ch1ck3n

Profile icon
ch1ck3n

@JBloves27
javascript:(function() {document.body.className = "replit-ui-theme-root light")(); for light mode

Profile icon
JBloves27

Got it, thanks a lot! :D

@ch1ck3n

Profile icon
JBloves27

Uh, I tried that, but it didn't work

@ch1ck3n
.

Profile icon
codingjlu

Sorry I'm not sure what this means, but it looks cool.

Profile icon
JBloves27

Np, so what it does is that its an api, meaning if you use the requests module to get the content, you can bookmark the code, and use it as a dark/light mode sync. Let me know if that was confusing lol. And thanks!

@codingjlu

Profile icon
codingjlu

@JBloves27
oh sort of like cookies not in a browser??? I think I'm totally messed up.

Profile icon
JBloves27

Uh, well not really

@codingjlu

Profile icon
codingjlu

@JBloves27
lol then what? Sorry I'm confused.

Profile icon
JBloves27

Np, basically, an api is something that can be accessible through coding langs, and you can use it for data, or just fundamental purposes.

@codingjlu

Profile icon
codingjlu

@JBloves27
okay cool

Profile icon
JBloves27
Profile icon
codingjlu

If you set the headers of /toggle to text/plain, it will appear as actual code instead of HTML (Times New Roman font).

Profile icon
JBloves27

Oh, ill try that asap, thanks so much!

@codingjlu

Profile icon
JBloves27

Wait, so make the headers /text/plain?

@codingjlu

Profile icon
codingjlu
Profile icon
JBloves27

Ah, ok. Thanks!

@codingjlu

Profile icon
codingjlu

@JBloves27
did it work?

Profile icon
JBloves27

I think so, is it supposed to be like that?

@codingjlu

Profile icon
codingjlu

@JBloves27
um... idk sorry I'm no good at python it should look like you're viewing something like a js file on a browser...

Profile icon
JBloves27

Ah, np. Ok, I think it might be working lol

@codingjlu

Profile icon
JBloves27

I hope you enjoy :)

Please don't overuse this :)