def respond(): # try: t = 1 ren = renren.Renren(account[0], account[1], account[2]) while 1: ren.check() tt = ren.getNotifications() i = 0 # print len(tt) while i != len(tt): ren.Respond(tt[i]) i += 1 if i == 0: if t < 120: t += 1 if i != 0: if t > 5: t = 5 elif t >= 1: t -= 1 time.sleep(t) print "respond time %d %d " % (t, len(tt))
def respond(): try: t=1 #ren=renren.Renren("*****@*****.**","asdf1234",'601700718') ren=renren.Renren("*****@*****.**","asdf1234",'601654416') while 1: ren.check() tt=ren.getNotifications() i=0 #print len(tt) while i!=len(tt): ren.Respond(tt[i]) i+=1 if i==0: if t<120 :t+=1; if i!=0: if t>5:t=5 elif t>=1:t-=1; time.sleep(t) except: tee=threading.Thread(target=respond) tee.setDaemon(True) tee.start()
def tt(): #ren=renren.Renren("*****@*****.**","asdf1234",'601700718') ren=renren.Renren("*****@*****.**","asdf1234",'601654416') winsound.Beep(1500,200) while 1: ren.check() rem=remind() t = time.localtime() ctt.uptime() try: if meng.update()==0:meng.update() except: meng.update() try: ss=que(t.tm_hour) except: ss="塔塔累了,休息一下" while 1: t = time.localtime() if t.tm_min==0: break; time.sleep(1) winsound.Beep(1500,200) content='塔塔报时:现在时间 '+time.strftime('%Y-%m-%d %H:%M:00',t)+" " content=(content+' '+rem)+ss ren.publish(content) time.sleep(1800) winsound.Beep(1500,200) if random.randint(0,10)==0: ren.check() d=ren.getrecentcomment() if d<24: s=meng.sad() elif d>48:s=meng.well() else:s="" if s!="": ren.publish(s) winsound.Beep(2500,200) time.sleep(1600)
def tt(): ren = renren.Renren(account[0], account[1], account[2]) while 1: ren.check() rem = remind() t = time.localtime() try: meng.update() except Exception, e: print "update error" try: ss = que(t.tm_hour) except: ss = "塔塔累了,休息一下" while 1: t = time.localtime() if t.tm_min == 0: break time.sleep(1) content = '塔塔报时:现在时间 '+time.strftime('%Y-%m-%d %H:%M:00', t)+" " content = (content+' '+rem)+ss ren.publish(content) time.sleep(1800) if random.randint(0, 10) == 0: ren.check() d = ren.getrecentcomment() if d < 24: s = meng.sad() elif d > 48: s = meng.well() else: s = "" if s != "": ren.publish(s) time.sleep(1600)
import renren r = renren.Renren() r.login('*****@*****.**', 'yueguang3356') print r.open('http://www.renren.com/295852491') #output=open('/Users/ericyue/data/renren/renren_random_users','a') #r.search(output)