Skip to content

Instantly share code, notes, and snippets.

@TheTechRobo
Created May 25, 2022 01:55
Show Gist options
  • Save TheTechRobo/55611181b0e32ffe8e8603327fb11427 to your computer and use it in GitHub Desktop.
Save TheTechRobo/55611181b0e32ffe8e8603327fb11427 to your computer and use it in GitHub Desktop.
Not really meant for public use
import re
import sys
print("URL: ", file=sys.stderr, end="")
url = input()
getId = lambda url : url.split("/")[-1].strip() or url.split("/")[-2].strip()
if re.match("https?://(www\.)?objection.lol/objection/", url):
splitted = getId(url)
print(f"https://api.objection.lol/objection/get?id={splitted}&isEdit=false")
print(f"https://api.objection.lol/objection/get?id={splitted}&isEdit=true")
elif re.match("https?://(www\.)?objection.lol/case/", url):
splitted = getId(url)
print(f"https://api.objection.lol/case/get?id={splitted}&isEdit=false")
print(f"https://api.objection.lol/case/get?id={splitted}&isEdit=true")
else:
raise ValueError("Not a valid objection.lol objection or case.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment