Twitch.tv chat textarea

matevos

Junior Member
Joined
Feb 4, 2012
Messages
137
Reaction score
11
Hello, I would like to type on twitch.tv chat through my vb .net application. I mean that I type text in program, and then I click send and the program is typing on twitch.tv chat and clicking chat. I know how to do this, but I have a problem, program can't find id of textarea object in twitch chat. Im using this code to type on chat:
Code:
WebBrowser1.Document.GetElementById("ember447").InnerText = "My text"

But this don't work, so I tried to find the chat area by class name so I used this
Code:
For Each webpageelement As HtmlElement In allelemtens
                If webpageelement.GetAttribute("className") = "ember-view ember-text-area" Then
                    webpageelement.InnerText = "My Text"                
                End If
            Next

This also won't work. Please help me.
 
Hello, I would like to type on twitch.tv chat through my vb .net application. I mean that I type text in program, and then I click send and the program is typing on twitch.tv chat and clicking chat. I know how to do this, but I have a problem, program can't find id of textarea object in twitch chat. Im using this code to type on chat:
Code:
WebBrowser1.Document.GetElementById("ember447").InnerText = "My text"

But this don't work, so I tried to find the chat area by class name so I used this
Code:
For Each webpageelement As HtmlElement In allelemtens
                If webpageelement.GetAttribute("className") = "ember-view ember-text-area" Then
                    webpageelement.InnerText = "My Text"                
                End If
            Next

This also won't work. Please help me.
You wont be able to do that because you need the OAUTH code generated for your account to be able to use other 3rd party programs other than the official twitch website to chat on any channel.


Use Streambot2 for an example, username: password: oauth
 
You wont be able to do that because you need the OAUTH code generated for your account to be able to use other 3rd party programs other than the official twitch website to chat on any channel.


Use Streambot2 for an example, username: password: oauth
Wow, that is not what op is asking.

Try:
Code:
WebBrowser1.Document.GetElementById("ember447").SetAttribute("Value", textbox1.text)
WebBrowser1.Document.GetElementById("chat").InvokeMember("click")
 
I did a project with this a while back, if the site is not updated sense then this should work:

Code:
WebBrowser1.Document.GetElementById("chat_text_input").SetAttribute("Value", "" & text)

This was with the pop up though, not while streaming the video.
 
When Im trying to load popup chat in my webbrowser control in my app it won't load. I just see a blank page, I the code won't work. When I try to load the whole stream with chat, chat is loading but when I click button to type something o chat I have an error: "Object reference not set to an instance of an object."

I use this code:
Code:
WebBrowser1.Document.GetElementById("ember447").SetAttribute("Value", "hello")

Its strange because I can click chat button on twitch chat via my program, but I can't type, it looks like webbrowser control can't load text chat area and it can't find the "ember447" object.
 
That error means that the element doesn't exist. You're trying to pull the element with ID ember447 and then perform an action on it but if ember447 doesn't exist then you will get an error.



OP: You'd be better just writing a basic IRC bot. You can connect to, view and type in the chat of any stream channel with as many accounts as you'd like. It will be far easier to expand on and much more powerful than trying to load a web browser inside your form.
 
Is there any other control than webbrowser, which I can use?
 
Leave webbrowser and study HTTP request + sockets (for Twitch IRC).
 
Ok did that typing in text area is working, but now I have problem with click on chat button, program is finding the chat button but he can't click it. There is no any error, just nothing happen, but when I click manually chat button the message which program typed, sends.
 
My guess is that the twitch page has some amount of protection to stop basic javascript style exploits. As we've mentioned before, you're better off using httprequest/sockets and write a basic IRC bot. Will let you handle chat MUCH better.
 
Back
Top