Skip to content

Instantly share code, notes, and snippets.

Created June 24, 2021 10:05
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Process OPML files from Feedly OPML export.
# Written by capjamesg
# Required dependencies: requests, beautifulsoup4
from bs4 import BeautifulSoup
import requests
# Please save your opml file as feed.opml before running this program, otherwise you'll encounter an error
with open("feed.opml", "r") as file:
contents =
soup = BeautifulSoup(contents, "lxml")
# Get a list of all RSS feeds in the file
items = soup.find_all("outline", attrs={"type": "rss"})
for i in items:
# Substitute these values for whatever you want to retrieve from the feed
print("[{}]({}) ([RSS feed]({}))".format(i["text"], i["htmlurl"], i["xmlurl"]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment