Inspiration

I saw there are a lot of developers on twitter who usually talk about new technologies, clear coding related doubt of others. Then I thought why do we need to write code in online compilers when the code is short when we can make a bot which will run the code for us right on twitter, so that we don't need to leave twitter and open any other site to run and share code.

What it does

It runs the provided code and replies with the output. For rendering, it takes the html, css, js codes and creates a path with the code and replies the url to the tweet. Users can use the bot either in main tweet or in reply to other tweets.

How we built it

We used piston to compile/run the code. When user mentions the bot with a command and code, the bot takes the code and compiles with the piston API and it saves the code in database. Then it replies to the tweet with the output and the url where user can see his/her code and output.

Challenges we ran into

The biggest challenge was hosting the bot. 😅 I didn't get any good free nodejs hosting service which can host the bot 24/7. However I finally hosted the bot on replit. Another challenge was registering webhook for listening to realtime events. As the old endpoints are deprecated and all the resources I got online to do it, unfortunately didn't work for me. Again I managed to achieve this with an workaround.

Accomplishments that we're proud of

It really feels awesome after making the bot which can help people on twitter.

What we learned

We learnt what people want and what they need. Explored the API and sharpened our coding skill.

What's next for Code runner

Now we will be working on new features while improving the performance of the bot.

Built With

Share this project:

Updates