Hack Forums
[Python] Imporvement challenge! - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Imporvement challenge! (/showthread.php?tid=4799641)



Imporvement challenge! - Pronickrc - Apr 29, 2015

So I have this code to login to twitch but does anyone know how to get it to enter a livestream and talk in chat?

Code
import mechanize

br = mechanize.Browser()
br.set_handle_robots(False)
br.open("htps://secure.twitch.tv/login")
br.select_form(nr=1)
br['login'] = "Login"
br['password'] = "Pass"
br.submit()

if "wrong username or password" in br.response().read():
    print "Wrong username or password"
else:
    print "Logged in"

I can't post links yet so add the t in the twitch link :P