Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Tyler Amend
2,236 PointsParsing an Active Chat Window
Hello All!
I have been doing some research on this project idea and I am struggling to get a foothold on what language to use and how to go about starting. I am interested in developing software that reads an active chat window and produces certain sentences when key a key word is typed ahead of the sentence with information necessary for it to interact with.
For example: say we were chatting on Yahoo Messenger and I wanted this program to analyze every sentence that had the string "ANALYZE:" as the first word in the string. How difficult is that to do and what language would be best to use for that?
Thanks in advance!
1 Answer
Steve Hunter
57,712 PointsHi Tyler,
I've come across code like this when using Twitter. There are various words and hashtags that force a bot to make some funny remark back at you ... using words like cheese, marmite, (and various swear words) trigger the response.
Twitter sits on Ruby on Rails but there's a full API to access it with whatever language. A quick Google of "Twitter bot code" gave me loads of examples.
So, I guess, the first starting point is to look at whether the chat environment you want to, erm, snoop on has an available API to use. If so, you are free to link to that API in whatever language works best for you. That could be Node.js, Rails, Angular - lots of options!!
Steve.
Tyler Amend
2,236 PointsTyler Amend
2,236 PointsSteve Hunter thank you for the quick response! I should have been a bit clearer. This would be a business application for a repetitive task at work that I think a bot could be very useful for. Rather than a human being doing these things maybe it could be done that way to generate chat confirmations we use daily. I will look into what you suggested. Thanks very much!
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsIf they're Office applications, you can link to their API with .NET languages like C++. Otherwise, you'd have to look at the application owner to see if there's a "way in" to the data stream. If there's a way of getting access to it behind the scenes then what you want to do is straightforward (he says, from a distance).