Created
May 25, 2022 01:55
-
-
Save TheTechRobo/55611181b0e32ffe8e8603327fb11427 to your computer and use it in GitHub Desktop.
Not really meant for public use
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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