Stuck with bot. How to put it online?

ptekspy

Newbie
Joined
Jan 18, 2017
Messages
21
Reaction score
6
I have made several bots for my IM journey. My only problem is how do I put the bot online and link it to a form that will maybe change parameters and start and stop the bot?

Most bots are in python. And a few in node.js

I have Google and googled but I am clearly not asking the right question. If someone could point me to the right language, technology or resource that does this that would be great

Thanks in advance :)
 
You can use python as a web application language so it shouldn't be too hard. Check out Flask or Django.
 
Flask or django. Thank you I haven't been there yet so this could solve it. I swear I have been trying to do this for 3 months. I hate asking for help when we have such a great resource like Google etc but thank you :)
 
Btw if this is a simple form you might want to give Flask a try over Django, as Django has a steeper learning curve.

Also look at Celery for running background tasks.
 
I have made several bots for my IM journey. My only problem is how do I put the bot online and link it to a form that will maybe change parameters and start and stop the bot?

If you want to host the bot online you will have to get your own server then setup Python on it along with a web server. Then you can just add some HTML and PHP for a form submission to send arguments to the bot.
A simple way of linking it to a form would be to use PHP GET requests, eg.
Code:
http://www.site.com/form_startbot.php?botlogin="twitterbot"&botpass="twitterpass"
Then that would just send those values through to bot.py and run it with those arguments through the console, eg.
Code:
exec("bot.py $botlogin $botpass");


But you shouldn't need to do that since you can just run it off your own computer (or a server) through a console and just send it arguments through that. Unless you are wanting to make it available to others to use online.
 
If you want to host the bot online you will have to get your own server then setup Python on it along with a web server. Then you can just add some HTML and PHP for a form submission to send arguments to the bot.
A simple way of linking it to a form would be to use PHP GET requests, eg.
Code:
http://www.site.com/form_startbot.php?botlogin="twitterbot"&botpass="twitterpass"
Then that would just send those values through to bot.py and run it with those arguments through the console, eg.
Code:
exec("bot.py $botlogin $botpass");


But you shouldn't need to do that since you can just run it off your own computer (or a server) through a console and just send it arguments through that. Unless you are wanting to make it available to others to use online.
Btw this will leave the server with a biig vulnerbility. The attackers will be able to pass arbitrary shell command in the botlogin and botpass query string. Be careful if you use this solution.
 
Flask or django. Thank you I haven't been there yet so this could solve it. I swear I have been trying to do this for 3 months. I hate asking for help when we have such a great resource like Google etc but thank you :)
Wise words, a man that atleast attempts to exhaust all his avenues before just sticking a hand out. It seems lIke alot of people don't even want to do simple things such as using a search engine, because they know someone will more than likely feel pity for them and just hand them an answer. I commend you bro, and I say that with the most sincerity.
 
When making your choice, remember that Flask if for pirates and Django is for the Navy... if you just need some API endpoints for controlling your bot then go for Flask and it will save you a lot of headaches
 
Back
Top