コード例 #1
0
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)
コード例 #2
0
ファイル: app.py プロジェクト: mayank26saxena/PokeBot
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)
コード例 #3
0
ファイル: example.py プロジェクト: Cofeiini/pokemongo-python
import time

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
コード例 #4
0
ファイル: example.py プロジェクト: murtidash/pokemongo-python
import copy
import time
import json
from  utils.spawns import Spawns
from skiplagged import Skiplagged
from config import userName,password
from utils.pokemon import Pokemon


if __name__ == '__main__':
    client = Skiplagged()
    
    bounds = (
                #Hollyberry
                #(34.053, -84.365), (34.061,-84.345)
                #Roswell
                (34.002572,-84.3799717), (34.074266,-84.3040977)
              )

    
    spawnpoints=Spawns('poke.json')
    spawnpoints.remove_duplicates()
    spawnpoints.save('poke2.json')

    while 1:
        try:
            # Log in with a Google or Pokemon Trainer Club account
            print client.login_with_google(userName, password)
            # print client.login_with_pokemon_trainer('USERNAME', 'PASSWORD')
            
            # Get specific Pokemon Go API endpoint
コード例 #5
0
ファイル: example.py プロジェクト: crim50n/pokemongo-python
 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)
コード例 #6
0
import os
import time
from datetime import timedelta
from datetime import datetime
from pytz import timezone
import re
from skiplagged import Skiplagged
from pushbullet import Pushbullet
from googlemaps import Client
from utils.pokemon import is_unique


        

if __name__ == '__main__':
    client = Skiplagged()
    pb = Pushbullet(os.getenv("PB_KEY"))
    gmaps = Client(os.getenv("GMAP_KEY"))


    #bounds = client.get_bounds_for_address('Isla Vista, CA')
    bounds = (
              (34.408359, -119.869816), # Lower left lat, lng
              (34.420923, -119.840293) # Upper right lat, lng
              )
    
    
    for channel in pb.channels:
        print channel
        if channel.channel_tag == '':
          my_channel = channel
コード例 #7
0
import time

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)
コード例 #8
0
ファイル: example.py プロジェクト: LeeGar/pokemongo-python
import time
import requests
import json

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('13290 SW Davies Rd Beaverton, OR 97008')

    def get_bounds_for_lat_long(self, lat, lon, offset=0.003):
        return (
                (lat - offset, lon - offset),
                (lat + offset, lon + offset),
                )
    
    while 1:
      try:
          # Log in with a Google or Pokemon Trainer Club account
          print client.login_with_google('', '')
          #print client.login_with_pokemon_trainer('USERNAME', 'PASSWORD')
          
          # Get specific Pokemon Go API endpoint
          print client.get_specific_api_endpoint()
          
コード例 #9
0
import sys
import time
import os

from skiplagged import Skiplagged

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

    try:
        bounds = (
            (
                float(os.environ['LOWER_LEFT_LATITUDE']),
                float(os.environ['LOWER_LEFT_LONGITUDE'])
            ),
            (
                float(os.environ['UPPER_RIGHT_LATITUDE']),
                float(os.environ['UPPER_RIGHT_LONGITUDE'])
            )
        )
    except KeyError as error:
        try:
            bounds = client.get_bounds_for_address(os.environ['BOUNDS_FOR_ADDRESS'])
            pass
        except KeyError as error:
            print "Please set some bounds through coordinates or an address"
            sys.exit(1)

    while 1:
        try:
コード例 #10
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)
コード例 #11
0
def main():
    sk = Skiplagged()
    # sk._call()
    sk._test()
コード例 #12
0
ファイル: example.py プロジェクト: ATwig/pokemongo-python
import time

from skiplagged import Skiplagged


if __name__ == '__main__':
    client = Skiplagged()
    
    bounds = (
              (38.818566, -77.447242), # Lower left lat, lng
              (38.837660, -77.434395) # 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)

            time.sleep(30)