SpiffyTtitles: Twitter/X add new template variables

{{content}}
{{name}}
{{nick}}
{{date}}
This commit is contained in:
Gordon Shumway 2023-10-17 01:46:08 -04:00 committed by GitHub
parent ac49779e72
commit a2645152a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1754,6 +1754,12 @@ class SpiffyTitles(callbacks.Plugin):
results = {}
soup = BeautifulSoup(response["html"])
results["text"] = soup.get_text(" ").strip()
match = re.match(r"(.*)—(.*) \((.*)\) (.*)", results["text"])
if match:
results["content"] = match.group(1)
results["name"] = match.group(2)
results["nick"] = match.group(3)
results["date"] = match.group(4)
template = Template(self.registryValue("twitter.template", channel))
title = template.render(results).strip()
if title: