From a4db2786c445db83c90ff712c84d36054652e101 Mon Sep 17 00:00:00 2001 From: David Kim Date: Sun, 7 Aug 2016 08:31:04 -0400 Subject: [PATCH] Read from accounts.txt Read from accounts.txt and accept tos --- scripts/accept-tos.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/scripts/accept-tos.py b/scripts/accept-tos.py index 4d33bb45..1c2c0d29 100644 --- a/scripts/accept-tos.py +++ b/scripts/accept-tos.py @@ -21,5 +21,32 @@ def accept_tos(username, password): response = req.call() print('Accepted Terms of Service for {}'.format(username)) #print('Response dictionary: \r\n{}'.format(pprint.PrettyPrinter(indent=4).pformat(response))) +#!/usr/bin/python +# -*- coding: utf-8 -*- + +"""accept-tos.py: Example script to accept in-game Terms of Service""" + +from pgoapi import PGoApi +from pgoapi.utilities import f2i +from pgoapi import utilities as util +from pgoapi.exceptions import AuthException +import pprint +import time +import threading + +def accept_tos(username, password): + api = PGoApi() + api.set_position(40.7127837, -74.005941, 0.0) + api.login('ptc', username, password) + time.sleep(2) + req = api.create_request() + req.mark_tutorial_complete(tutorials_completed = 0, send_marketing_emails = False, send_push_notifications = False) + response = req.call() + print('Accepted Terms of Service for {}'.format(username)) + #print('Response dictionary: \r\n{}'.format(pprint.PrettyPrinter(indent=4).pformat(response))) + +with open('accounts.txt') as f: + accounts = [x.strip().split(':') for x in f.readlines()] -accept_tos('username', 'password') \ No newline at end of file +for username,password in accounts: + accept_tos(username, password)