Creating an RSS Feed for any Medium Thread!

Barbara Streisand
Release: 2024-11-03 12:03:02
Original
885 people have browsed it

I was scrolling through project ideas to do in 30 mins for a quick refresher on the weekend, and stumbled across codementor.io

So, what exactly is an RSS Feed?

RSS stands for Really Simple Syndication — It is a methodology to access the metadata of a website through an XML file.

For example, there are multitudes of articles and publications done on Medium, wouldn’t it be so convenient that all links with the summary available on a single page?

Well the answer to that is — RSS feeds! These were pretty popular a couple of years ago but aren’t really made use of anymore, BUT websites still provide support for you to create your own RSS feed.

Recently I started reading Intermezzo and wanted to read reviews and latest updates on it on Medium, and then I thought maybe I can create an RSS feed for this?

Well, a quick search helped me find out that Medium does support RSS feed creation through their endpoints with the XML metadata of Medium on that particular metadata.

You can find it here - https://help.medium.com/hc/en-us/articles/214874118-Using-RSS-feeds-of-profiles-publications-and-topics

I wrote a quick Python code using the library feedparser — which internally parses the XML file to get the required metadata. I also did the same with BeautifulSoup if you want to parse the metadata on your own as well.

You can checkout the documentation for feedparser here — https://feedparser.readthedocs.io/en/latest/

I parsed and retrieved the medium metadata using the following piece of code —

parsed_feed = feedparser.parse(url)
for article in parsed_feed["entries"]:
    response_article.append({
        "Title": article["title"],
        "Description": html2text.html2text(article["summary"]),
        "Author": article["author"],
        "Date Published": article["published"],
        "Last Updated": article["updated"]
    })
Copy after login

To make it more user friendly I create a quick Python class and had a user input the URL from which the metadata should be received, you can find the link to the complete code on Carbon or Github:

Github: https://github.com/harmankaler2000/RSS_Feeder

Carbon: https://carbon.now.sh/mHN9yVFtZZmkopLHFEe3

Creating an RSS Feed for any Medium Thread!

I would love to connect and discuss more on python, please feel free to drop a comment and we can chat!

The above is the detailed content of Creating an RSS Feed for any Medium Thread!. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template