def find_startup( name ): url = "https://api.angel.co/1/search?access_token=%s&type=Startup&query=%s" % (access_token, name) results = bot_utils.load_json( url ) if results is None or len( results ) == 0: return None al_id = None if results is None else results[0].get( "id" ) if al_id is not None: al_data = bot_utils.load_json( "https://api.angel.co/1/startups/%s" % al_id ) if al_data is not None: if bot_utils.match_all( al_data, al_checks ): startup = create( al_data ) crunchbase.find_startup( startup, name ) return startup return None
def find_startup(name): url = "https://api.angel.co/1/search?type=Startup&query=%s" % name results = bot_utils.load_json(url) if results is None or len(results) == 0: return None al_id = None if results is None else results[0].get("id") if al_id is not None: al_data = bot_utils.load_json("https://api.angel.co/1/startups/%s" % al_id) if al_data is not None: if bot_utils.match_all(al_data, al_checks): startup = create(al_data) crunchbase.find_startup(startup, name) return startup return None
def recent_startups( startup_map, url, max=1000 ): print( "AngelList.recent_startups => %s" % url ) results = bot_utils.load_json( url ) count = 0 if results is not None: for al_data in results.get( "startups" ): if bot_utils.match_all( al_data, al_checks ): name = al_data.get( "name" ); if startup_map.get( name ) is None: startup = create( al_data ) startup_map[ name ] = startup crunchbase.find_startup( startup, name ) print( "Found via AL: " + name ) count = count + 1 if count > max: break return startup_map;
def recent_startups(startup_map, url, max=1000): print("AngelList.recent_startups => %s" % url) results = bot_utils.load_json(url) count = 0 if results is not None: for al_data in results.get("startups"): if bot_utils.match_all(al_data, al_checks): name = al_data.get("name") if startup_map.get(name) is None: startup = create(al_data) startup_map[name] = startup crunchbase.find_startup(startup, name) print("Found via AL: " + name) count = count + 1 if count > max: break return startup_map