initial commit
This commit is contained in:
commit
c474b7d96d
2 changed files with 61 additions and 0 deletions
20
unfurl.py
Executable file
20
unfurl.py
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env python
|
||||
import sys
|
||||
import urllib.parse
|
||||
|
||||
if not sys.stdin.isatty():
|
||||
url = sys.stdin.read().strip()
|
||||
elif len(sys.argv) > 1:
|
||||
url = sys.argv[1]
|
||||
else:
|
||||
url = input("Paste URL: ")
|
||||
|
||||
# Extract between ___ markers
|
||||
start = url.find("___") + 3
|
||||
end = url.find("___", start)
|
||||
|
||||
if start > 2 and end > 0:
|
||||
extracted = url[start:end]
|
||||
print(urllib.parse.unquote(extracted))
|
||||
else:
|
||||
print("Could not find ___ markers")
|
||||
Loading…
Add table
Add a link
Reference in a new issue