Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import smtplib
- import time
- try:
- # For Python 3.0 and later
- from urllib.request import urlopen
- except ImportError:
- # Fall back to Python 2's urllib2
- from urllib2 import urlopen
- sub = True
- url = 'https://www.twitch.tv/products/' + streamer_name
- while(sub):
- try:
- response = urlopen(url)
- sub = False
- break
- except:
- time.sleep(30)
- gmail_user = 'user'
- gmail_password = 'pass'
- froms = gmail_user
- to = ['ilovefreespam4real@gmail.com']
- body = 'HAS A SUB BUTTON \n' + url
- try:
- server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
- server.ehlo()
- server.login(gmail_user, gmail_password)
- server.sendmail(froms, to, body)
- server.close()
- print( 'Email sent!')
- except:
- print ('Something went wrong...')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement