From 084887f69ef9229da3c8e2d09c34839ca8180aef Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 25 Aug 2013 19:54:21 -0300 Subject: Adding config file --- config | 10 ++++++++++ httracker | 1 + scuttler | 20 ++++++++++++-------- 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 config diff --git a/config b/config new file mode 100644 index 0000000..c426b1f --- /dev/null +++ b/config @@ -0,0 +1,10 @@ +# Httracker default configuration +MIRRORS="/var/cache/sites/arquivo/conteudo/links.sarava.org/assets" +FEED="https://links.sarava.org/rss?sort=date_desc&count=100" +TMP="/tmp/httracker" +URLS="$TMP/urls.txt" +LEVEL="1" +EXT_LEVEL="1" +FILESIZE="" +USER="arquivo" +GROUP="arquivo" diff --git a/httracker b/httracker index e720f76..c59004a 100755 --- a/httracker +++ b/httracker @@ -4,6 +4,7 @@ # # Configuration +source config || exit 1 MIRRORS="/var/cache/sites/arquivo/conteudo/links.sarava.org/assets" FEED="https://links.sarava.org/rss?sort=date_desc&count=100" TMP="/tmp/httracker" diff --git a/scuttler b/scuttler index dbfe025..6d67e5f 100755 --- a/scuttler +++ b/scuttler @@ -3,11 +3,13 @@ # Download all links from a Semantic Scuttle instance. # +# Configuration +source config || exit 1 + +# Other parameters BASEDIR=/var/sites/links SCUTTLEDIR=`basename $( find ${BASEDIR} -maxdepth 1 -iname "SemanticScuttle-*" | head -n 1 )` CONFIGFILE=${BASEDIR}/${SCUTTLEDIR}/data/config.php -MIRRORDIR=${BASEDIR}/mirrors -TMPDIR=/tmp # Load functions source lib/httracker/functions || exit 1 @@ -30,13 +32,15 @@ sqlquery() { --execute="${1}" } -# grabs URLs from db -tmpfile=`mktemp -p ${TMPDIR}` -chown links.links ${tmpfile} -chmod 600 ${tmpfile} -sqlquery "select bAddress from sc_bookmarks;" > ${tmpfile} +# Grab URLs from db +URLS=`mktemp -p ${TMP}` +chown links.links ${URLS} +chmod 600 ${URLS} +sqlquery "select bAddress from sc_bookmarks;" > ${URLS} +# Prepare and download httracker_target_single httracker_get_single -rm ${tmpfile} +# Cleanup +rm -rf $TMP -- cgit v1.2.3