I am a (very) beginner programmer and I am wondering if it would be feasible to write a very simple chat room bot which is fairly dependent of what kind of chat room is being used.
The scenario is that a friend of mine has a basic chat room set up (https://blueimp.net/ajax/) just for a few buddies to use, but I want to make a "bot" account that exists only on the client machine (mine). So, it would continually check the browser (without reloading the page) for a particular string and then respond if it detects it. Just as an example, maybe they would type !bot song and it would return with a song recommendation.
I was thinking Applescript could be an easy way to do this. Can anyone possibly help get me started? Like I said, I'm a beginner so please keep that in mind. Trying to use this as a learning experience, and I learn best by trying to come up with a solution to a particular scenario rather than by books or tutorials.
Essentially, the flow would be something like:
- Check webpage for string every 2 seconds (it's Ajax-based, no need to refresh... just check the browser window itself)
- If string is found, reply in the first text field with response + enter
I know this isn't the most efficient way to make a chat bot, I'm just trying to use this scenario to help me understand how applications interact with each other locally. :)