From 46bf011613eda177e7ce666646417711c167de33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 29 Nov 2020 17:27:00 +0100 Subject: Add 'pc', 'pd', 'pi' and 'pl' tools --- Makefile | 2 ++ pc | 14 ++++++++++++++ pd | 5 +++++ pi | 7 +++++++ pl | 14 ++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 Makefile create mode 100755 pc create mode 100755 pd create mode 100755 pi create mode 100755 pl diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..71a3b87 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +install: + install p* /usr/local/bin/ diff --git a/pc b/pc new file mode 100755 index 0000000..a891740 --- /dev/null +++ b/pc @@ -0,0 +1,14 @@ +#!/bin/sh + +curl -Ls "$@" | +sed -n '//,$p' | +sed -e '/^$/d' -e 's/^[ ]*//' | +awk -vFS='[<>]' ' + // { print "Date: " $3; } + // { print "Subject: " $3; } + /<itunes:summary>/ { print "Summary: " $3; } + /<enclosure[^>]*>/ { print "Link: " $0; } + /<itunes:duration>/ { print "Duration: " $3; } + /<\/item>/ { print ""; } +' | +sed 's,<enclosure[^>]* url="\([^"]*\)".*,\1,' diff --git a/pd b/pd new file mode 100755 index 0000000..7bcaead --- /dev/null +++ b/pd @@ -0,0 +1,5 @@ +#!/bin/sh + +# pd -- download podcast episode(s) + +curl -Z `sed -n 's/Link: /-OJL /p'` diff --git a/pi b/pi new file mode 100755 index 0000000..851bc74 --- /dev/null +++ b/pi @@ -0,0 +1,7 @@ +#!/bin/sh + +# pi -- interactive podcast downloader + +pc "$(pl "$@")" | +ep | +pd diff --git a/pl b/pl new file mode 100755 index 0000000..b041a92 --- /dev/null +++ b/pl @@ -0,0 +1,14 @@ +#!/bin/sh + +# pl -- podcast list + +bw=https://feeds.buzzsprout.com/424075.rss +hhh=https://heretichappyhour.podbean.com/feed.xml +mm=http://www.myterochmysterier.se/feed/myterochmysterier/ +pvk=https://paulvanderklay.podbean.com/feed.xml +shearer=http://feeds.soundcloud.com/users/soundcloud:users:25261528/sounds.rss +storm=https://rss.acast.com/stormensutveckling +ts=https://rss.art19.com/thinkspot-presents +unb=https://unbelievable.podbean.com/feed.xml + +eval echo \$$1 -- cgit v1.2.3