From 48334ea5e2ef5af4c3ee65cd8896b5452cf98b2e Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Wed, 2 Jul 2025 03:18:02 +0900 Subject: modified newsboat/urls, deleted bin/decode, created bin/decodetitle --- ar/.local/bin/decode | 17 ----------------- ar/.local/bin/decodetitle | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) delete mode 100755 ar/.local/bin/decode create mode 100755 ar/.local/bin/decodetitle (limited to 'ar/.local') diff --git a/ar/.local/bin/decode b/ar/.local/bin/decode deleted file mode 100755 index e7a553c..0000000 --- a/ar/.local/bin/decode +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 - -import html -import sys -import xml.etree.ElementTree as ET - -text_input = sys.stdin.read() -root = ET.fromstring(text_input) - -# RSS 2.0: -for item in root.findall(".//item"): - title = item.find("title") - if title is not None and title.text: - title.text = html.unescape(title.text) - -# re-serialize -sys.stdout.buffer.write(ET.tostring(root, encoding="utf-8", xml_declaration=True)) diff --git a/ar/.local/bin/decodetitle b/ar/.local/bin/decodetitle new file mode 100755 index 0000000..e7a553c --- /dev/null +++ b/ar/.local/bin/decodetitle @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import html +import sys +import xml.etree.ElementTree as ET + +text_input = sys.stdin.read() +root = ET.fromstring(text_input) + +# RSS 2.0: <channel><item><title> +for item in root.findall(".//item"): + title = item.find("title") + if title is not None and title.text: + title.text = html.unescape(title.text) + +# re-serialize +sys.stdout.buffer.write(ET.tostring(root, encoding="utf-8", xml_declaration=True)) -- cgit v1.2.3