Intevation / downloadclient

GDI-BY DownloadClient
Apache License 2.0
1 stars 4 forks source link

Implement ATOM feed downloads #36

Closed s-l-teichmann closed 8 years ago

s-l-teichmann commented 8 years ago

The datasets referenced by ATOM feeds must be downloadable.

s-l-teichmann commented 8 years ago

Für ./src/resources/fromGist/Downloadschritt-Atom.xml aus dem Repo sollte das in etwa wie folgt laufen (als Bash-Skript):

``#!/bin/bash

STEP="$1"

URL=xmlstarlet sel -t -v "/DownloadSchritt/URL/text()" "$STEP"

DATASET=xmlstarlet sel -t -v "/DownloadSchritt/Dataset/text()" "$STEP" WERT=xmlstarlet sel -t -v "/DownloadSchritt/Parameters/Parameter[Name/text()='VARIATION']/Wert/text()" "$STEP"

echo "URL: $URL"

echo "Dataset: $DATASET" echo "Wert: $WERT"

curl "$URL" > feed.xml

i=0 curl "$DATASET" | \ xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -v "//atom:entry[atom:id/text()='"$WERT"']/atom:link/@href" - | sed 's/&/&/g' - | while read ext; do dst=printf "%03d.tiff" $i echo $dst curl $ext > $dst i=$((i+1)) done

s-l-teichmann commented 8 years ago

They are implemenent now.