Ejemplo n.º 1
0
			counter = doactions(counter, ACTION, message.id , ID)
			if (msglen == counter) :
				break
	elif msgfolder == "Spam" :
		voice.spam()
		folder = voice.spam.folder
		msglen = len(folder.messages)
		for message in folder.messages:
			counter = doactions(counter, ACTION, message.id , ID)
			if (msglen == counter) :
				break
	elif msgfolder == "Trash" :
		voice.trash()
		folder = voice.trash.folder
		msglen = len(folder.messages)
		for message in folder.messages:
			counter = doactions(counter, ACTION, message.id , ID)
			if (msglen == counter) :
				break
	elif msgfolder == "Missed" :
		msglen = len(voice.missed().messages)
		for message in voice.missed().messages:
			counter = doactions(counter, ACTION, message.id , ID)
			if (msglen == counter) :
				break
except: 
	print ("Error! With" + msgfolder +", " + ACTION + " and " + ID + "Message ID's.")
 
print ACTION + " " + str(counter) + " Messages."
voice.logout()
Ejemplo n.º 2
0
	voice.spam()
	folder = voice.spam.folder
	foundmsg = [ msg for msg in folder.messages]
elif command == "Trash" :
	voice.trash()
	folder = voice.trash.folder
	foundmsg = [ msg for msg in folder.messages]
elif command == "Placed" :
	folder = voice.placed().messages
	foundmsg = [ msg for msg in folder]
elif command == "Received" :
	voice.received()
	folder = voice.received.messages
	foundmsg = [ msg for msg in folder]
elif command == "Missed" :	
	folder = voice.missed().messages
	foundmsg = [ msg for msg in folder]
#elif command == "History" :
	#try:
		#phone = argv[4]
		#folder = voice.search(phone)
		#foundmsg = [ msg for msg in folder.messages if (msg.messageText != "") ]
	#except:
		#print ('Error! Please provide a phone number. ')
		#voice.logout()
		#exit(0)
else:
	folder = voice.search(command)
	foundmsg = [ msg for msg in folder.messages]

if foundmsg != []:
Ejemplo n.º 3
0
	allmessages = extractdata(voice.sms.html)
elif command == "All" :
	voice.all()
	allmessages = extractdata(voice.all.html)
elif command == "Spam" :
	voice.spam()
	allmessages = extractdata(voice.spam.html)
elif command == "Trash" :
	voice.trash()
	allmessages = extractdata(voice.trash.html)
elif command == "Placed" :
	voice.placed()
	allmessages = extractdata(voice.placed.html)
elif command == "Received" :
	voice.received()
	allmessages = extractdata(voice.received.html)
elif command == "Missed" :	
	voice.missed()
	allmessages = extractdata(voice.missed.html)

if allmessages != []:
	foundmsg = [msg for msg in allmessages if (msg['id'] == unicode(ID))]

if foundmsg != []:
	foundmsg.sort(key=lambda x:x['time'], reverse=False)
	print json.dumps(foundmsg, indent=4, default=str)
else:
	print ('Nothing found! ')

voice.logout()