Hello Fellow Mirc users
I am currently trying to finish my script, so I can read the 1 line text I have on a webpage.
My Code:
alias test {
sockopen test host.com 80
}
on *:sockopen:test: {
sockwrite -n $sockname GET /index.php?test=1 HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
sockwrite -n $sockname Host: host.com
sockwrite -n $sockname Accept-Language: en-us
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname
}
on *:sockread:test: {
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temp
sockread -f %temp
}
}
on *:text:!test:#: {
var %temp $test()
msg $chan %temp
}
I use my own webpage instead of host.com in my script.
The script is not working now, and that's why I kindly ask for your help
It's supposed work like this when it's used in twitchs chat:
!test command is used -> It opens the socket, goes to the website and return the text from the webpage.
It shouldn't be a problem since source code at: /index.php?test=1 returns: Hello This is a test.
I hope anyone can help me further with my problem