BetterTwitFix/utils.py
2024-05-02 17:28:44 +01:00

11 lines
230 B
Python

import re
pathregex = re.compile("\\w{1,15}\\/(status|statuses)\\/(\\d{2,20})")
def getTweetIdFromUrl(url):
match = pathregex.search(url)
if match is not None:
return match.group(2)
else:
return None