Example #1
0
def connect(ID1,ID2):
	base.login('trash')
	while True:
		print('triy')
		base.login(ID1)
		base.login(ID2)
		connection1 = getResponse(ID1)['events'][-1]['from']
		if connection1 == ID2:
			return True
		base.disconnect(connection1)
		response2 = base.keep(ID2)
		if ('events' in response2):
			base.disconnect(response2['events'][-1]['from'])
Example #2
0
def bind(ID,startid=0):
	print('logginiging') 
	base.login(ID+'_cat'+str(startid))
	base.login(ID)
	base.login(ID+'_cat'+str(startid+1))
	print('done')

	connected = None
	while connected == None:
		for response in getResponse(ID)['events']:
			if response['type'] == 'connected':
				connected = response['from']
				break

	if connected[:-5] == ID:
		return connected
	else:
		base.disconnect(connected)
		return bind(ID,startid+2)