Inquiry about some stuff
-
@jeffreyrb03-gmail on a scale of 1-10, how much experience do you have with using node js for api interactions, I am thinking about doing something very overly complicated to make message storage easier for my chatrooms project. I can do this programming myself but if you have the knowledge to help me make some scripting I’d welcome all the help (I have already used the api I need to use and made several projects so I can do it if you don’t want to help)
-
@tyller_
js means javascript I think… what does api mean? -
@011830-0a42ef84 I’m just wondering if jeff would like to help me with a project I am dedicated to expanding in an overly complicated way, api is how you interact with special services, like discord bots use the discord bot api
-
@tyller_ around 7.5 to be honest. I don’t consider myself great at NodeJS, since there is an immense amount of stuff to memorize and I used to use it SOOO much in early 2023 however I took a forced break and have just recently come back to it in like September of this year. However I can do things since I usually read a TON of documentation and google things when I need help.
I can help you with (almost) whatever you need concerning NodeJS and APIs however I can’t always code nodejs so it might take me a little bit to fullfill your request. To elaborate I don’t own a laptop anymore but I have a school chromebook which unfortunately blocks Glitch and Github, but during my study hall periods in school I always go to the media center and they have PCs there that we can freely use. The blockers are super relaxed on them so I usually code YN3D’s nodejs backend and listen to music. I do creaticode on my school chromebook since its luckily always unblocked. The media centers are closed for like a week tho bc some kid died and theyre doing therapy sessions, so yeah my time to code (non-creaticode) is not as much as it used to be.
Basically I will probably take long to help you if it means coding like making an API on GitHub or Glitch.com since those are blocked on my school chromebooks and the blockers are absolutely hell, since they use AI to scan a page on the spot and then either allow it or block it, so almost anything not educational like games or too indepth hacking/programming related will get blocked. If scripts is all you need then I can do that
-
@tyller_ I will have to use Glitch tho if you require database features (not the Database blocks) because Glitch offers free small but good enough databases for every nodeJS project. But yeah just tell me what you want me to make you. Also, since this is a sort of bigger help than usual, maybe we could make a trade before I commit? This might cut into my already limited time that I have to develop YN3D unless it’s something small but its ok.
-
@011830-0a42ef84 API means application programming interface (i didnt have to google that lol, got it memorized). Basically what all that nonsense which even I don’t understand means is a somewhat special URL or “endpoint” that can be accessed to provide information of any kind, mainly text and sometimes images, to you or an app. For example, go to here:
https://uselessfacts.jsph.pl/api/v2/facts/random
This API just gives you a random fun fact as some small JSON data.
Apps and websites use these more often because APIs return code or plaintext data which is usually unappealing to human eyes, and then they use that data to do what they need and/or transform/display that data too, like how a weather app uses a weather API to style and display weather data with icons and colors and the background and whatnot.Hope this explanation helps!
Now in terms of CreatiCode, APIs are useful because the blocks and platform are a bit limited in what they can do. I mean CreatiCode is very allowing and much better than original Scratch, but there’s always something that there isn’t a block for and since there is a cloud fetch URL block technically anything is possible. For example, I realized there isn’t a math block for cube root, only just square root. I was planning to make an API for that but I’ve been busy. Then, with the API, that allows for cube roots and makes it possible. This might not be a great example since there’s actually better ways to accomplish getting cube roots (like writing a math formula to a google sheet and then reading it again to see the result of that formula) but it’s great if you absolutely need something that currently CreatiCode is not capable of.
-
@jeffreyrb03-gmail all my plans involve self hosting on my laptop (its how I hosted my discord bots), wher eI use the google api (already used to download files to google drive, don’t ask I went insane trying to) to constantly read a google sheet for changes (or set a handler) and run some stuff when somebody writes to a sheet, which automatically formats the message data into another sheet which all clients can read (but the project isn’t shared), also you can’t write formulas to a google sheet, trying to prefix anyhting with = when writing a table will put ’ infront of it in the google sheet
-
@tyller_ That sounds like a good idea since self hosting always gives you more control than something else either free or paid for just a bit more work. What exactly do you need my help with? I’m sorry but I’m not exactly at that level yet in terms of my computer knowledge since I like to use online services to make things as there isn’t really a more conveinient way for me
-
@jeffreyrb03-gmail I just need some ideas on how to implement it, not 100% sure on my logistics plan with this
edit: also we have to use google sheets if we do go through with this because my home wifi doesn’t allow website hosting (looked it up to verify I wasn’t being stupid with the port forwarding not working) so I don’t think using fetch webpage as markdown (and chanigng like an unused parameter url so it doesn’t cache) would work unless you can use that not to send the delayed fetches (creaticode said it lets page content load)
-
@tyller_ since formulas don’t work with the blocks in GS, just use an API. Like if you need cube root then fetch a url like example.com/cuberoot?n=8. The same applies to your messaging system but im not sure.
-
@jeffreyrb03-gmail I host things on glitch so when I have the time I could prolly make an API for you
-
@jeffreyrb03-gmail Im going to try using google apps scripts, currently I’m attempting to find the rate limits but am unable to find the free rate limits for any of it
-
@tyller_ Ok. You say this is to “make message storage easier” but idk this looks like a lot more errors and work are gonna come out of this than if you just used a different method like perhaps a queue system where messages are stored in a database (in creaticode) and then pushed gradually over to google sheets and retrieved when needed like for saving chats like a discord like app
-
@jeffreyrb03-gmail that does seem like a much better idea, but whats the limit on the database row count, I’d asusme it’d be about the semantic or knn limit (100 for regular users 200 for premium, I was reading docs and scrolled over it)
-
@tyller_ not sure but the current database storage should be fine and if youre really worried about that then you can use multiple databases to sort of preserve as much storage as possible. Besides ur pushig it all to GS anyways so no worries about that
-
@jeffreyrb03-gmail yeah, but with uploading I’m thinking about all the logistics of not having two clients try uploading at the same time, and what if the client being used to upload data just closes the tab (when the warning when you try to leave the project page is added that won’t be an issue, unless request animation frame is paused by that prompt) I have many ideas and I think I have the willingness to try some rnrrr
-
@tyller_ yeah that stuff is always an issue with creaticode because there is no “server” or “backend” with projects, just client that can do server things using CC’s main backend. I don’t know how to fix that issue other than extensive testing and checking what will happen.
Edit: im referring to the thing about if someone closes the tab and data get s messed up -
@jeffreyrb03-gmail yeah, with projects that require a server my idea is you just assign the oldest client (or if it’s a project with a lobby the host) to be the server and have some checks so if the host leaves the world then the project tries to assign a new host, the pop up when you try to close the page would make it a lot easier to have the client acting as the server “gracefully” transition the status of server or save data when they try to leave
-
@tyller_ I thought of this before but I’d have a computer always on that acts as the server but that’s a whole other issue and idk how to do it without buying a computer and making it run 24/7
-
@jeffreyrb03-gmail okay so my current plan is to have it write to the sheet in a specific cell and use an extension in sheets to either copy the raw data (one cell for it all, using join with and some stuff to prevent the data from escaping, if you want to know what I mean then ask) to one cell, and have the user just read all the data and format it on the client, or I can have the user post data to a random place in a receiving sheet and the extension copy’s all the data that the client posted into the sheet