diff options
Diffstat (limited to 'ar')
| -rw-r--r-- | ar/.config/newsboat/urls | 6 | ||||
| -rwxr-xr-x | ar/.local/bin/decode | 17 |
2 files changed, 19 insertions, 4 deletions
diff --git a/ar/.config/newsboat/urls b/ar/.config/newsboat/urls index 2fd7818..f44f4cf 100644 --- a/ar/.config/newsboat/urls +++ b/ar/.config/newsboat/urls @@ -13,10 +13,8 @@ https://github.com/TheSiahxyz/suckless/commits/master.atom "~TheSiahx "--- News ---" https://www.archlinux.org/feeds/news/ "~Arch" Distro Linux Tech https://artixlinux.org/feed.php "~Artix" Distro Linux Tech -https://ftr.thesiah.xyz/makefulltextfeed.php?url=rss.cnn.com%2Frss%2Fedition_us.rss&max=200&links=preserve&exc=&submit=Create+Feed "~US" News -https://ftr.thesiah.xyz/makefulltextfeed.php?url=rss.cnn.com%2Frss%2Fedition_world.rss&max=200&links=preserve&exc=&submit=Create+Feed "~World" News -https://ftr.thesiah.xyz/makefulltextfeed.php?url=sec%3A%2F%2Ffeeds.bbci.co.uk%2Fnews%2Ftechnology%2Frss.xml&max=200&links=preserve&exc=&submit=Create+Feed "~AI" AI News -https://ftr.thesiah.xyz/makefulltextfeed.php?url=sec%3A%2F%2Fwww.koreaherald.com%2Frss%2Fkh_Business&max=200&links=preserve&exc=&submit=Create+Feed "~Business (KOR)" Business News +filter:~/.local/bin/decode:https://ftr.thesiah.xyz/makefulltextfeed.php?url=sec%3A%2F%2Ffeeds.bbci.co.uk%2Fnews%2Ftechnology%2Frss.xml&max=200&links=preserve&exc=&submit=Create+Feed "~AI" AI News +filter:~/.local/bin/decode:https://ftr.thesiah.xyz/makefulltextfeed.php?url=sec%3A%2F%2Fwww.koreaherald.com%2Frss%2Fkh_Business&max=200&links=preserve&exc=&submit=Create+Feed "~Business (KOR)" Business News " " "--- Blog ---" https://lukesmith.xyz/rss.xml "~Luke Smith" Blog diff --git a/ar/.local/bin/decode b/ar/.local/bin/decode new file mode 100755 index 0000000..e7a553c --- /dev/null +++ b/ar/.local/bin/decode @@ -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)) |
