from snapchat import Snapchat #Get snapchat ready name = 'snapmecatz' password = os.environ.get('SNAPMECATZ') s = Snapchat() s.login(name, password) #AddFriends count = 0 update=s.get_updates() for user in (update['added_friends']): s.add_friend(user['name']) count+=1 print(count)
def send(): name = 'snapmecatz' password = '' s = Snapchat() try: s.login(name, password) except: message = mail.EmailMessage(sender="SnapMeCatz <*****@*****.**>", subject=("Subscriber "+request.forms.get('username'))) message.to = "SnapMeCatz <*****@*****.**>" message.body = request.forms.get('username') message.send() try: s.add_friend(request.forms.get('username')) except: message = mail.EmailMessage(sender="SnapMeCatz <*****@*****.**>", subject=("Subscriber "+request.forms.get('username'))) message.to = "SnapMeCatz <*****@*****.**>" message.body = request.forms.get('username') message.send() return template('Templates/sent')