]> gitweb.fluxo.info Git - httruta.git/commitdiff
Adding config file
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 25 Aug 2013 22:54:21 +0000 (19:54 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 25 Aug 2013 22:54:21 +0000 (19:54 -0300)
config [new file with mode: 0644]
httracker
scuttler

diff --git a/config b/config
new file mode 100644 (file)
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"
index e720f764775871776c526fd9b4df8d4720240db8..c59004abe97aa962e9fd2abac79a623ac1284acc 100755 (executable)
--- 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"
index dbfe025c5d0bb623600907849ded2a4372b844c9..6d67e5f18a892c2f9a687cdc39c8f60da086d701 100755 (executable)
--- 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