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 getbests(amount='all'): #login username = request.args.get('username', '') password = request.args.get('password', '') s = Snapchat() s.login(username, password) if amount == 'all': return Response(json.dumps(s.get_updates()['updates_response']['added_friends']), mimetype='text/javascript') if amount == 'bests': return Response(json.dumps(s.get_updates()['updates_response']['bests']), mimetype='text/javascript')