Go-OPML

OPML to JSON Converter with RSS Feed Fetching

View on GitHub

Features

Getting Started

  1. Download the latest release for your platform from the GitHub releases page
  2. Extract the downloaded file
  3. Open a terminal and navigate to the extracted directory
  4. Run the following command to convert an OPML file to JSON:
    ./Go-OPML -input your_file.opml -output result.json
  5. To also fetch RSS feeds, add the -fetch-rss flag:
    ./Go-OPML -input your_file.opml -output result.json -fetch-rss

Usage

./Go-OPML -input <input_opml_file> -output <output_json_file> [options]

Options


-concurrency int
      Number of concurrent RSS feed fetches (default 5)
-fetch-rss
      Fetch RSS feeds and include episode information
-input string
      Path to the input OPML file
-max-episodes int
      Maximum number of episodes to fetch per podcast (default 10)
-output string
      Path to the output JSON file (default "output.json")
-timeout duration
      Timeout for fetching RSS feeds (default 30s)
            

Examples

Sample OPML


<?xml version="1.0" encoding="UTF-8"?>
<opml>
    <head/>
    <body version="1.0">
        <outline xmlUrl="https://feeds.megaphone.fm/thediaryofaceo" title="The Diary Of A CEO with Steven Bartlett"/>
        <outline xmlUrl="https://feeds.simplecast.com/e_GRxR9a" title="Azeem Azhar's Exponential View"/>
        <outline xmlUrl="http://feeds.harvardbusiness.org/harvardbusiness/ideacast" title="HBR IdeaCast"/>
    </body>
</opml>
                    

Resulting JSON


[
  {
    "title": "The Diary Of A CEO with Steven Bartlett",
    "url": "https://feeds.megaphone.fm/thediaryofaceo",
    "episodes": [
      {
        "title": "The Investing Expert: We're Raising The Most Unhappy Generation In History!",
        "link": "",
        "publishDate": "2024-07-11T05:00:00Z",
        "description": "The millionaire entrepreneur revealing Wall Street's secrets and simplifying finance for the masses..."
      }
    ]
  },
  {
    "title": "Azeem Azhar's Exponential View",
    "url": "https://feeds.simplecast.com/e_GRxR9a",
    "episodes": [
      {
        "title": "The Science of Making Truthful AI",
        "link": "https://hbr.org/podcasts/exponential-view",
        "publishDate": "2024-02-07T13:17:29Z",
        "description": "Artificial Intelligence is on every business leader's agenda..."
      }
    ]
  },
  {
    "title": "HBR IdeaCast",
    "url": "http://feeds.harvardbusiness.org/harvardbusiness/ideacast",
    "episodes": [
      {
        "title": "Why We Should Pay More Attention to Departing CEOs",
        "link": "https://hbr.org/podcast/2024/07/why-we-should-pay-more-attention-to-departing-ceos",
        "publishDate": "2024-07-09T13:00:32Z",
        "description": "When news breaks of a CEO succession, much of the attention is given to the new leader..."
      }
    ]
  }
]
                    

Performance Showcase

Test Results


$ time ./Go-OPML -input jad.opml -output output.json -fetch-rss
Successfully processed OPML and generated JSON. Output written to output.json

real    0m3.813s
user    0m1.662s
sys     0m0.238s
                

Total execution time: 3.813 seconds

Number of feeds processed: 19

Average time per feed: Approximately 0.2 seconds