AnimalSay
- 2 Devlogs
- 3 Total hours
A simple bot made to emulate the famous cowsay library, but not just cows.
A simple bot made to emulate the famous cowsay library, but not just cows.
So, I shipped my project, but a nice person reviewed it and said that I can’t host it on Render because it isn’t guaranteed to be hosted forever, and it spins down after inactivity. So, what I have done is to put it up on Hack Club Nest. Seriously, whoever came up with this and the domains is goated. What do you mean I get a perpetually running private VM and domains like *.iolas.hackclub.app for free? Anyways, just tested it, and it now works, so, I guess I’ll finally ship it.
Smol update: You can play around with the bot in the #animalsay-fun channel un the Hack Club Slack workspace.
Okay, I forgot to post devlogs while actually making it, so I’m doing it now, I guess. Welcome to Animalsay!
If you’ve used Python extensively, randomly scrolled through pypi.org or taken CS50 course for Introduction to Python, you’ll probably know about cowsay, a library which takes text from you and outputs it as said by an ASCII cow. Now, I loved the idea, so I decided to make the Slack bot when I sw it was one of the suggested projects on Hack Club. SO excited was I that I did not see they have a guide for it.
I wrote the basic logic in Python first, and then tested it in the terminal. Then, I moved to a local server with Flask and tested then, then with ngrok, and finally pushed it to Github and uploaded it to run on Render. It’s free, so I’m happy. The only con is that it spins down after inactivity and takes about a minute to wake up when called. Eh, still worth it. If I had read the guide, I could have uploaded it to Hack Club Nest, but it still works. The next steps are to test it in a private Slack workspace first before uploading it to Hack Club’s workspace.
If you want to use it, you’re welcome to. To access it online, go to: https://animalsay.onrender.com
After it wakes up, you can go here: https://animalsay.onrender.com/animalsay?text=random+hello!
This will output a random animal saying hello! to you. You can replace entire string after text with ‘help’ to see available commands, ‘list’ to know which animals are supported, ‘random’+text separated by + signs to output a random animal with said text and ‘’+text for a specific animal. Complicated, but this is the only way I can get HTTP requests to my program.
Bye for now, I’ll go back and start working on more features.