aboutsummaryrefslogtreecommitdiff
path: root/httracker
blob: 385035c3bc9b596d0e15f4ed2eeded8ae55779e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
#
# Httrack feed downloader.
#

# Configuration
source config || exit 1

# Load functions
source lib/httracker/functions || exit 1

# Create folders
mkdir -p $MIRRORS $TMP

# Get URL
# Thanks http://stackoverflow.com/questions/443991/how-to-parse-rss-feeds-xml-in-a-shell-script
curl -s "$FEED" | grep -o '<link>[^<]*' | grep -o "[^>]*$" > $URLS

if [ "$?" != "0" ]; then
  echo "Error downloading feed $FEED, aborting."
  exit 1
fi

# Iterate over all URLs
httracker_iterate

# Cleanup
rm -rf $TMP