#!/usr/bin/env sh # Takes an opml file as first argument and creates a feeder-enabled maildir for each feed # The folder name will be the title as defined in the @text attr set -e cat $1 | xq '.opml.body.outline[]' -rc | while read outline ; do url=$(echo $outline | jq '."@xmlUrl"' -r) dir=$(echo $outline | jq '."@text"' -r) mkdir -p "$dir"/{cur,new,tmp} # make it maildir echo "$url" > $dir/url echo $dir done