INNER CODE UNIT · Python

get_own_location

zapek/Xeres · scripts/bot/bot.py:92

def get_own_location():
	r = requests.get(XERES_API_URL + XERES_API_PREFIX + "/locations/1")
	if r.status_code != 200:
		raise RuntimeError("Couldn't get own location")
	return json.loads(r.text)


def get_own_rsid():
	r = requests.get(XERES_API_URL + XERES_API_PREFIX + "/locations/1/rs-id")
	if r.status_code != 200:
		raise RuntimeError(f"Couldn't get own RsId: {r.status_code}")
	return json.loads(r.text).get("rsId")


def add_friend(id):
	r = requests.post(XERES_API_URL + XERES_API_PREFIX + "/profiles?trust=FULL", json={'rsId': id})
	if r.status_code != 201:
		raise RuntimeError(f"Couldn't add friend: {r.status_code}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…