Skip to content

Instantly share code, notes, and snippets.

@ronsen
Created August 8, 2025 06:21
Show Gist options
  • Save ronsen/5a1bfe8bf6be62cb64a6bac475fb69e6 to your computer and use it in GitHub Desktop.
Save ronsen/5a1bfe8bf6be62cb64a6bac475fb69e6 to your computer and use it in GitHub Desktop.
Read RSS feed
#!/bin/python
import sys
import feedparser
def scheme(url):
if not url.startswith(('http://', 'https://')):
return 'https://' + url
return url
def main(url):
feed = feedparser.parse(url)
for entry in feed.entries:
print(entry.title)
print(entry.link)
print('')
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Usage: ./rss.py <URL>")
sys.exit(1)
main(scheme(sys.argv[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment