I’ll introduce a script to extract RSS feed URLs from Apple Podcasts.
curl -s "https://podcasts.apple.com/jp/podcast/podcast-name/podcast-id" \
| egrep -o 'https?://[^"]+(/rss|\.rss)'
Here’s an explanation of the script:
This script makes it easy to extract RSS feed URLs for podcasts on Apple Podcasts. Podcast RSS feeds are essential elements for automatically updating episodes.
This script uses two command line tools: curl
and egrep
.
curl -s "https://podcasts.apple.com/jp/podcast/podcast-name/podcast-id"
-s
means silent mode, preventing display of progress messages. It retrieves HTML data from the specified URL.| egrep -o 'https?://[^"]+(/rss|\.rss)'
|
passes curl’s output to the next egrep.egrep -o
is an option that outputs only the matched portions. The regular expression https?://[^"]+(/rss|\.rss)
catches the main parts that constitute URLs and extracts those containing /rss
or .rss
.This script is very simple but can be applied to other web pages. Customizations are possible to extract feed URLs from other podcast platforms or web pages that provide RSS feeds.
That’s all from the Gemba.