# Httrack feed downloader.
#
-# Configuration
-source `dirname $0`/config || exit 1
-
-# Functions
+# Load and initialize
source `dirname $0`/lib/httracker/functions || exit 1
-# Create folders
-httracker_setup_folders
-
# Get URLs from feed
# 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
chown -R $USER.$GROUP $TMP
fi
}
+
+# Set basic environment
+function httracker_set_env {
+ source `dirname $0`/config || exit 1
+
+ # Create folders
+ httracker_setup_folders
+}
+
+# Initialize
+httracker_set_env
# Download all links from a Semantic Scuttle instance.
#
-# Configuration
-source `dirname $0`/config || exit 1
-
-# Functions
+# Load and initialize
source `dirname $0`/lib/httracker/functions || exit 1
-# Create folders
-httracker_setup_folders
-
# Other parameters
-SCUTTLE_BASE="/var/sites/links"
SCUTTLEDIR="`basename $( find ${SCUTTLE_BASE} -maxdepth 1 -iname "SemanticScuttle-*" | head -n 1 )`"
CONFIGFILE="${SCUTTLE_BASE}/${SCUTTLEDIR}/data/config.php"
DBUSER="`httracker_scuttle_config dbuser`"