Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

The program itself

  • Loading branch information...
commit ede78d134214c2de438b3d7dec0149bc7a32a344 1 parent 27ea497
@steamdnt authored
Showing with 49 additions and 0 deletions.
  1. +49 −0 gluebot.py
View
49 gluebot.py
@@ -0,0 +1,49 @@
+import urllib2 as url
+import urllib
+import httplib as http
+import cleverbot
+myses = cleverbot.Session()
+def fmtId( string ):
+ return string[1:len( string ) - 1]
+
+def talk(id,req,messagestr):
+ #typing = url.urlopen('http://omegle.com/typing', '&id='+id)
+ #typing.close()
+ msg = myses.Ask(messagestr)
+ print msg
+ msgReq = url.urlopen('http://omegle.com/send', '&msg='+msg+'&id='+id)
+ msgReq.close()
+
+
+
+
+
+
+
+def listenserv(id,req):
+ while True:
+ site = url.urlopen(req)
+ rec = site.read()
+ if 'waiting' in rec:
+ print 'waiting'
+ elif 'connected' in rec:
+ print 'Got one!'
+ messagestr = 'Hello'
+ talk(id,req,messagestr)
+ elif ' strangerDisconeccted' in rec:
+ print 'He left, What a cunt.'
+ connect()
+ elif 'typing' in rec:
+ print 'he is typing..'
+ elif 'gotMessage' in rec:
+ messagestr = rec[16:len( rec ) - 2]
+ print(messagestr)
+ talk(id,req,messagestr)
+def connect():
+ site = url.urlopen('http://omegle.com/start','')
+ id = fmtId( site.read() )
+ print(id)
+ req = url.Request('http://omegle.com/events', urllib.urlencode( {'id':id}))
+ listenserv(id,req)
+
+connect()
Please sign in to comment.
Something went wrong with that request. Please try again.