Home

Awesome

RSS-OPML-to-Markdown


ReadMe of this forked repo

Intro

Turn OPML into a Markdown table with key infomation of RSS feeds such as publish frequency etc.

Pro and Con

Functions or known issuesrss_opml_to_markdown_Feedsearch_version.pyrss_opml_to_markdown_feedparser_version.py
Sequence Number (to tell how many feeds in the OPML)
Feed Title
Detect Site URL from RSS feed URL✅ but might not be correct due to that some feeds put other link address rather than site url in the namespace of link
Feed URL
If the outermost level of outline signifies the Feed Category, extract it
Works with OPML with more than 2 levels of outline
Show the time of Last Updated
Humanize the time difference between last updated and now
Show Item Count
Show Content Length (bytes of the RSS xml file)
Show the mean number of items per day (or be interpreted as publish frequency)
Show Language if RSS feed has language namespace
Show feed type version
Tell whether it's a Podcast feed✅ Simple detection according to enclosure and itunes-related namespace
Able to handle OPML with huge amount of RSS Feeds❌ due to API limitation
SSLError Problem like EOF occurred in violation of protocol or SSL: CERTIFICATE_VERIFY_FAILEDSeldomPartially resolved as requests.Session() has been involved. It seems still an open issue for feedparser
Put those 'Fetch failed' RSS Feeds together at the bottom of the generated Markdown table

Usage

python rss_opml_to_markdown_Feedsearch_version.py {The name and path of the OPML file} {the name and path of the outputed .MD file}

Or

python rss_opml_to_markdown_feedparser_version.py {The name and path of the OPML file} {the name and path of the outputed .MD file}

Bonus

opml_merge.py: merge all OPML files (that has no more than 2 levels of outline fields) in a certain folder into one OPML file.

Usage: python opml_mergy.py {The path of the folder containing OPML files} {the name and the path of the outputed OPML file or the path of the folder for the outputed file}

Demo

OPML content:

<opml version="2.0">
  <head>
    <title>My Subscriptions</title>
  </head>
  <body>
    <outline title="News" type="rss">
      <outline title="BBC News" type="rss" xmlUrl="https://feeds.bbci.co.uk/news/rss.xml"/>
    </outline>
    <outline title="Tech" type="rss">
      <outline title="The Verge" type="rss" xmlUrl="https://www.theverge.com/rss/index.xml"/>
    </outline>
  </body>
</opml>

P.S. the above sample OPML file is provided by Google Bard.

If using rss_opml_to_markdown_Feedsearch_version.py

OPML -> Markdown

Markdown preview:

TitleURLLast UpdatedPodcastItem CountContent LengthThe mean number of items per dayDetected feed type version
BBC Newshttps://feeds.bbci.co.uk/news/rss.xml2023-10-17T15:01:41+00:00False94529240.459rss20
The Vergehttps://www.theverge.com/rss/index.xml2023-10-17T15:00:00+00:00False102349696.583atom10

If using rss_opml_to_markdown_feedparser_version.py

Markdown preview:

Sequence NumberTitleSite URLFeed URLCategoryLast UpdatedItem CountContent Length (bytes)The mean number of items per dayLanguageDetected feed type versionPodcast feed or not
1小众软件https://www.appinn.comhttps://feed.appinn.com/网络资源🥗14h6m ago101232482.63zh-CNrss20False
2异次元软件世界https://www.iplaysoft.comhttp://feed.iplaysoft.com/网络资源🥗1d11h ago604838340.75zh-CNrss20False
3電腦玩物http://www.playpcesor.com/http://feeds.feedburner.com/playpc网络资源🥗4d9h ago1512010130.40not foundatom10False
4免費資源網路社群https://free.com.twhttp://feeds.feedburner.com/freegroup网络资源🥗19h14m ago101512801.11zh-TWrss20False
5反斗软件 » 反斗软件https://www.apprcn.comhttp://www.apprcn.com/feed网络资源🥗2023 August 07, 15:5910533800.08zh-CNrss20False
6少数派https://sspai.comhttps://sspai.com/feed网络资源🥗11h10m ago10222839.51zh-CNrss20False
7编程随想https://program-think.blogspot.com/https://feeds2.feedburner.com/programthink网络资源🥗2021 May 09, 15:43517885450.10not foundatom10False
8Rat's Bloghttps://www.moerats.com/https://www.moerats.com/feed网络资源🥗2022 January 22, 15:04101406220.01zh-CNrss20False
9如有乐享https://51.ruyo.nethttps://51.ruyo.net/feed/网络资源🥗20h34m ago101257120.42zh-CNrss20False
10活动优惠https://jike.info/category/5https://jike.info/category/5.rss网络资源🥗8h8m ago254549310.33not foundrss20False
11神代綺凜の萌化小基地https://moe.best/https://moe.best/feed网络资源🥗2023 July 17, 08:5710200530.01zh-CNrss20False
12不死鸟https://iui.su/https://hao.su/feed/网络资源🥗1d5h ago201776290.90zh-CNrss20False
13Anyway.FM 设计杂谈https://anyway.fmhttp://anyway.fm/rss.xml网络资源🥗2023 October 23, 18:2117718558420.06zh-CNrss20True
14老殁 - 殁漂遥https://www.mpyit.comhttps://www.mpyit.com/feed网络资源🥗16h5m ago102389133.52zh-CNrss20False
15Windows软件破解fetch failedhttps://downloadly.ir/feed/网络资源🥗fetch failedfetch failedfetch failedfetch failedfetch failedfetch failedfetch failed
16Saodayefetch failedhttps://saodaye.com/feed网络资源🥗fetch failedfetch failedfetch failedfetch failedfetch failedfetch failedfetch failed

Motivation

When I'm interested in a new found RSS feed, I'd like to know more about it. For example, a property or index indicates how often a certain RSS feed is publishing its new items would be much better for me to determine subscribing to it or not. Thus, I first combined RSS-OPML-to-Markdown with Feedsearch API. Now, by utilizing the power of Feedsearch API, one can easily type python rss_opml_to_markdown_Feedsearch_version.py {The name and path of the OPML file} {the name and path of the outputed .MD file} to obtain 'Title', 'URL','Last Updated','Is Podcast','Item Count','Content Length','The mean number of items per day' and 'Detected feed type version' of a certain RSS feed listed in the OPML file. Notice that one might encounter the API usage limitation if there are more than 10 feeds contained in the OPML file.

In order to bypass the limitation of Feedsearch API, another approach utilizing feedparser has been developed. Hence, it does not matter if there are a plenty of RSS feeds in an OPML file.

Acknowledgement

Inspired by


Readme of the origional repo

🎁 Please take my RSS list!

RSS-OPML-to-Markdown 可以将从平台导出的 OPML 文件转化为易读的 Markdown 表格的形式,便于分享与展示

目前已在 inoreadertiny tiny RSS 上进行测试

Demo

转换前 OPML -> 转换后 Markdown

How to Use

本项目基于 Python3 构建,依赖包 listparsertabulate

使用pip安装

  1. 下载项目
pip install RSS-OPML-to-Markdown
  1. 使用项目
rss_opml_to_markdown {OPML文件的位置与名称} {期望输出markdown文件的位置与名称}

注:后一参数为空则输出结果到控制台

Planned Features

Contribute

如果有任何想法或需求,可以在 issue 中告诉我们,同时欢迎各种 pull requests

Open-source Licenses

This project is under MIT license, feel free to use it under the license.