diff options
| author | Silvio Rhatto <rhatto@riseup.net> | 2013-08-25 22:14:43 -0300 | 
|---|---|---|
| committer | Silvio Rhatto <rhatto@riseup.net> | 2013-08-25 22:14:43 -0300 | 
| commit | 05ce52fe580b015d5cc21e0c31a999970a34f4d5 (patch) | |
| tree | fa5863f92b74649cf9ec40a628cff4cc98811785 | |
| parent | ad49b915a0c6fee46015bad16fa5bfa5d0082325 (diff) | |
| download | httruta-05ce52fe580b015d5cc21e0c31a999970a34f4d5.tar.gz httruta-05ce52fe580b015d5cc21e0c31a999970a34f4d5.tar.bz2 | |
More cleanup and merging
| -rwxr-xr-x | httracker | 8 | ||||
| -rw-r--r-- | lib/httracker/functions | 11 | ||||
| -rwxr-xr-x | scuttler | 9 | 
3 files changed, 13 insertions, 15 deletions
| @@ -3,15 +3,9 @@  # 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 diff --git a/lib/httracker/functions b/lib/httracker/functions index 0885206..8e8964e 100644 --- a/lib/httracker/functions +++ b/lib/httracker/functions @@ -107,3 +107,14 @@ function httracker_setup_folders {      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 @@ -3,17 +3,10 @@  # 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`" | 
