mirror of
https://github.com/streetturtle/awesome-wm-widgets.git
synced 2024-11-17 07:49:09 +01:00
16 lines
334 B
Python
16 lines
334 B
Python
#!/usr/bin/python
|
|
|
|
import imaplib
|
|
import re
|
|
|
|
M=imaplib.IMAP4_SSL("mail.teenagemutantninjaturtles.com", 993)
|
|
M.login("mickey@tmnt.com","cowabunga")
|
|
|
|
status, counts = M.status("INBOX","(MESSAGES UNSEEN)")
|
|
|
|
if status == "OK":
|
|
unread = re.search(r'UNSEEN\s(\d+)', counts[0].decode('utf-8')).group(1)
|
|
else:
|
|
unread = "N/A"
|
|
|
|
print(unread)
|