diff options
author | lassulus <lassulus@lassul.us> | 2022-06-07 15:46:12 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2022-06-07 15:46:12 +0200 |
commit | b3786c3a74fce6a742649c37ab2ad1255f5864bf (patch) | |
tree | a5453da91d868781b2339722a4e7bf588993ac09 /makefu/2configs/deployment/rss/ratt-hourly.sh | |
parent | e6f67aa910f78ecf75f3a47a0794497148c60c2b (diff) | |
parent | 53855cd2d0dadb159215c5ed12e6d0be02dca98b (diff) |
Merge remote-tracking branch 'gum/22.05'
Diffstat (limited to 'makefu/2configs/deployment/rss/ratt-hourly.sh')
-rwxr-xr-x | makefu/2configs/deployment/rss/ratt-hourly.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/rss/ratt-hourly.sh b/makefu/2configs/deployment/rss/ratt-hourly.sh new file mode 100755 index 000000000..67f2529bd --- /dev/null +++ b/makefu/2configs/deployment/rss/ratt-hourly.sh @@ -0,0 +1,28 @@ +#!/bin/sh +set -eu +URLS=${1?must provide URLS file} +OUTFILE=${2:-all.xml} + +echo "init, writing to $OUTFILE" + +cat > "$OUTFILE" <<EOF +<?xml version="1.0" encoding="UTF-8"?> +<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"> + <channel> + <title>makefu Ebay Kleinanzeigen</title> + <link>https://www.ebay-kleinanzeigen.de/</link> + <description>Feed for all kleinanzeigen</description> + <pubDate>$(date '+%a, %d %b %Y %H:%M:%S %z')</pubDate> +EOF +echo "looping through $URLS" +cat "$URLS" | while read line;do + echo "fetching $line" + ratt auto "$line" | \ + xmlstarlet sel -t -c "//item" >> "$OUTFILE" || : +done + +echo "close" +cat >> "$OUTFILE" <<EOF + </channel> +</rss> +EOF |