예제 #1
0
 def run(self):
     client = Skiplagged()
     if self.location_method == 'area':
                 bounds = (
                         (float(self.location[0]), float(self.location[1])),
                         (float(self.location[2]), float(self.location[3]))
                         )
     elif self.location_method == 'google':
                 bounds = client.get_bounds_for_address(' '.join(self.location))
     while 1:
         try:
             print client.login_with_pokemon_trainer(self.user, self.password)
             # Log in with a Google or Pokemon Trainer Club account
             if self.auth_method == 'ptc':
                 print client.login_with_pokemon_trainer(self.user, self.password)
             elif self.auth_method == 'google':
                 print client.login_with_google(self.user, self.password)
     
             # Get specific Pokemon Go API endpoint
             print client.get_specific_api_endpoint()
     
             # Get profile
             print client.get_profile()
     
             # Find pokemon
             for pokemon in client.find_pokemon(bounds):
                 print pokemon
         except Exception as e:
             print('Unexpected error: {0}'.format(e))
             time.sleep(1)
def scan(config):
  ((username, password), bounds) = config
  filteredList = []
  if os.path.isfile(filterFile):
    with open(filterFile, "r") as filterFile:
      for line in filterFile:
        filteredList.append(line[:-1])
  client = Skiplagged()
  while 1:
    try:
      # print client.login_with_pokemon_trainer(username, password)
      print client.login_with_google(username, password)
      print client.get_specific_api_endpoint()
      print client.get_profile()
      for pokemon in client.find_pokemon(bounds):
        location = pokemon.get_location()
        location = (location["latitude"], location["longitude"])
        dist = distance(home, location)
        output = "{}: Distance {}.".format(pokemon.get_name(), dist)
        if pokemon.get_name() in filteredList:
          output = "***** " + output
          if notifications and dist <= radius:
            subprocess.call([
                # terminal-notifier must be installed
                "terminal-notifier",
                "-title", pokemon.get_name(),
                "-message", "At ({}, {}).".format(location[0], location[1])])
        print output
    except Exception as e:
        print "Exception:", str(e)
        time.sleep(1)
예제 #3
0
def login(address, sender_id):
     while 1:
         try:
             client = Skiplagged()
             bounds = client.get_bounds_for_address(address)
 
             usernames = ["prattylolo2", "prattylolo3", "prattylolo4", "prattylolo5", "prattylolo6"]
             passwords = ["prattylolo2", "prattylolo3", "prattylolo4", "prattylolo5", "prattylolo6"]
 
             n = randint(0, 4)
 
             username = usernames[n]
             password = passwords[n]
 
             log("username = "******"password = "******"Pokemons near " + str(address) +  " are - "
             send_message(sender_id, str(address_message))
 
             i = 0
             for pokemon in client.find_pokemon(bounds):
                 #send_message(sender_id, str(pokemon))
                 s = str(pokemon)
                 index_of_colon = s.index(":")
                 list_of_commas = find(s, ",")
                 index_of_comma = list_of_commas[-1]
                 s1 = s[:index_of_colon]
                 s2 = s[index_of_comma:]
                 s3 = s1+s2
                 send_message(sender_id, s3)
                 i += 1
                 if (i == 5) :
                     return
 
         except Exception as e:
             log("Exception: {0} {1}".format(e.message, e.args))
             time.sleep(1)
예제 #4
0
 def run(self):
     client = Skiplagged()
     bounds = client.get_bounds_for_address(self.location)
     while 1:
         try:
             # Log in with a Google or Pokemon Trainer Club account
             if self.auth_method == 'ptc':
                 print client.login_with_pokemon_trainer(self.user, self.password)
             elif self.auth_method == 'google':
                 print client.login_with_google(self.user, self.password)
     
             # Get specific Pokemon Go API endpoint
             print client.get_specific_api_endpoint()
     
             # Get profile
             print client.get_profile()
     
             # Find pokemon
             for pokemon in client.find_pokemon(bounds):
                 print pokemon
         except Exception as e:
             print('Unexpected error: {0} {1}'.format(e.message, e.args))
             time.sleep(1)
예제 #5
0
from skiplagged import Skiplagged


if __name__ == '__main__':
    client = Skiplagged()
    
    bounds = (
              (40.76356269219236, -73.98657795715332), # Lower left lat, lng
              (40.7854671345488, -73.95812508392333) # Upper right lat, lng
              ) # Central park, New York City
#     bounds = client.get_bounds_for_address('Central Park, NY')
    
    while 1:
        try:
            # Log in with a Google or Pokemon Trainer Club account
        #     print client.login_with_google('GOOGLE_EMAIL', 'PASSWORD')
            print client.login_with_pokemon_trainer('USERNAME', 'PASSWORD')
            
            # Get specific Pokemon Go API endpoint
            print client.get_specific_api_endpoint()
            
            # Get profile
            print client.get_profile()
            
            # Find pokemon
            for pokemon in client.find_pokemon(bounds):
                print pokemon
        except Exception as e:
            print "exception:", e
            time.sleep(1)
            
예제 #6
0
from skiplagged import Skiplagged

if __name__ == '__main__':
    client = Skiplagged()

    bounds = (
        (40.76356269219236, -73.98657795715332),  # Lower left lat, lng
        (40.7854671345488, -73.95812508392333)  # Upper right lat, lng
    )  # Central park, New York City
    #     bounds = client.get_bounds_for_address('Central Park, NY')

    while 1:
        try:
            # Log in with a Google or Pokemon Trainer Club account
            #     print client.login_with_google('GOOGLE_EMAIL', 'PASSWORD')
            print client.login_with_pokemon_trainer('USERNAME', 'PASSWORD')

            # Get specific Pokemon Go API endpoint
            print client.get_specific_api_endpoint()

            # Get profile
            print client.get_profile()

            # Find pokemon
            for pokemon in client.find_pokemon(bounds):
                print pokemon
        except Exception as e:
            print("Exception: {0} {1}".format(e.message, e.args))
            time.sleep(1)