Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read from accounts.txt #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion scripts/accept-tos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
for username,password in accounts:
accept_tos(username, password)