Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pymailinator.wrapper import Inbox
- from pushover import init, Client
- import time
- mailinator_key = "" # mailinator API key
- mailinator_inbox = "" # mailbox name
- pushover_key = "" # pushover API key
- pushover_token = "" # pushover user token
- check_frq = 10 # frequency in minutes for checking mailinator
- def SendPushNote(push_title, push_message, push_link):
- init(pushover_token)
- client = Client(pushover_key).send_message(push_message, title=push_title, url=push_link)
- def CheckMail():
- inbox = Inbox(mailinator_key)
- inbox.get(mailinator_inbox)
- mail_count = inbox.count()
- while mail_count > 0:
- mail_id = mail_count - 1
- mail = inbox.messages[mail_id]
- mail.get_message()
- mail_link = "https://www.mailinator.com/inbox.jsp?to=%s" % (mailinator_inbox)
- mail_body = "From: %s Recv Time: %s" % (mail.fromfull, mail.time)
- mail_count = mail_count - 1
- if not mail.been_read:
- SendPushNote(mail.subject, mail_body, mail_link)
- CheckMail()
- if __name__ == "__main__":
- while True:
- CheckMail()
- time.sleep(check_frq * 60) # check_frq in minutes * 60 seconds
Add Comment
Please, Sign In to add comment