def test_signal(self, data = "MODE=init"): """sends a test request""" zx = "".join([chr(random.randint(97,122)) for i in xrange(0, 11)]) resdat = webrequest("GET", "wave.google.com", "/wave/wfe/test?VER=6&"+data+"&zx="+zx+"&t=1", {'Cookie': self.cookie}, None ) return resdat
def retrieve(self, sid): """fetch the currently seeked result""" zx = "".join([chr(random.randint(97,122)) for i in xrange(0, 11)]) resdat = webrequest("GET", "wave.google.com", "/wave/wfe/channel?VER=6&RID=rpc&SID="+sid+ "&CI=0&AID=0&TYPE=xmlhttp&zx="+zx+"&t=1", {'Cookie': self.cookie}, None) file("./tempdata","w+").write(resdat) print resdat
def search(self, sid, group = "*****@*****.**", num = 100, start = 0): """returns search result for all group messages""" self.crid += 1 zx = "".join([chr(random.randint(97,122)) for i in xrange(0, 11)]) a = "".join([chr(random.randint(97,122)) for i in xrange(0, 8)]) resdat = webrequest("POST", "wave.google.com", "/wave/wfe/channel?VER=6&"+ "SID="+sid+"&RID="+str(self.crid)+ "&zx="+zx+"&t=1", {'Cookie': self.cookie}, {"count" : "2", "req0_key" : '{"a":"'+a+'","r":"0","t":2007,"p":{"1000":[0,0],"2":"'+a+'0"}}', "req1_key" : '{"a":"'+a+'","r":"1","t":2602,"p":{"1000":[0,0],"2":"'+a+'2","3":"","4":{"2":'+str(num)+',"1":'+str(start)+'},"6":"'+group+'"}}'} ) print resdat pass
def get_sid(self): """returns a wave-usable SID""" self.crid += 1 zx = "".join([chr(random.randint(97,122)) for i in xrange(0, 11)]) resdat = webrequest("POST", "wave.google.com", "/wave/wfe/channel?VER=6&RID="+str(self.crid)+ "&CVER=3&zx="+zx+"&t=1", {'Cookie': self.cookie}, {"count" : "0"} ) print resdat resdat = self.parse_response(resdat) if (resdat[0][1][0] != "c"): return None sid = resdat[0][1][1] return sid