]> gitweb.fluxo.info Git - httruta.git/commitdiff
Initial code for webkit2png and wkhtmltopdf
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 16 Oct 2015 18:04:51 +0000 (15:04 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 16 Oct 2015 18:04:51 +0000 (15:04 -0300)
.gitmodules [new file with mode: 0644]
README.mdwn
TODO.mdwn
config.default
httracker
lib/httracker/functions
scuttler
webkit2png [new submodule]

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..c68f047
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "webkit2png"]
+       path = webkit2png
+       url = https://github.com/adamn/python-webkit2png
index 6d9bbbf106578afe0c2fe876f890ec8acedfc9cf..dcee8e59a1c583f15d25a45feff4c4fe086377ea 100644 (file)
@@ -10,3 +10,9 @@ Usage
 Place this script somewhere and setup a cronjob like this:
 
 `*/5 * * * * /var/sites/cache/httruta/httracker &> /dev/null`
+
+Features
+--------
+
+- Integration with http://wkhtmltopdf.org
+- Integration with [webkit2png](http://www.paulhammond.org/webkit2png/).
index 259a6f9925e7983127c95f89cec28dd2b329ade5..847759e3621e36292c06de665edbd17759e72ae2 100644 (file)
--- a/TODO.mdwn
+++ b/TODO.mdwn
@@ -4,5 +4,6 @@ TODO
 - OPML support to retrieve URLs from multiple feeds.
 - Support for other fetchers like youtube-dl and quvi.
 - Cleanup content no longer pointed in scuttle database.
-- Integration with http://wkhtmltopdf.org
-- Integration with [webkit2png](http://www.paulhammond.org/webkit2png/).
+- Scuttler:
+  - Support to generate only an index of all URLs.
+  - Support to retrieve posts using the API.
index 7b9543a01cfbdbedf60ea9dd76c748e34a4dc87c..6b7f44bb4c19a1a5c9d54b2cdee2b2a66cd23f49 100644 (file)
@@ -10,3 +10,5 @@ GROUP="cache"
 DEPTH="1"
 EXT_DEPTH="0"
 SCUTTLE_BASE="/var/sites/links"
+WEBKIT2PNG="1"
+WKHTMLTOPDF="1"
index f899f0698655bf6028353e8a009b9bc493ce4602..bf97a6c44104082ad19f4598538f5f1f5fbde433 100755 (executable)
--- a/httracker
+++ b/httracker
@@ -7,6 +7,7 @@
 source `dirname $0`/lib/httracker/functions || exit 1
 
 # Parameters
+DIRNAME="`dirname $0`"
 BASENAME="`basename $0`"
 FILE="$1"
 
index d8477696e4940290f4ec9b6638bc0451424e57f4..ce3dd29bb038bfadd862d7c335767a7db4d7bdc3 100644 (file)
@@ -66,6 +66,16 @@ function httracker_get {
     rm -rf $TARGET
   fi
 
+  # Get a screenshot
+  if [ "$WEBKIT2PNG" == "1" ]; then
+    $DIRNAME/webkit2png/webkit2png/webkit2png.py -o $TARGET/screenshot.png "$url"
+  fi
+
+  # Build a PDF
+  if [ "$WKHTMLTOPDF" == "1" ] && which wkhtmltopdf &> /dev/null; then
+    wkhtmltopdf "$url" $TARGET/screenshot.pdf
+  fi
+
   # Fix permissions again
   if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then
     echo "Fixing $TARGET permissions..."
index e4f741925005636aaacfad438a6a04904f259dd7..3275712a14aab2eb2558f9541348cee5e9f4656d 100755 (executable)
--- a/scuttler
+++ b/scuttler
@@ -6,6 +6,10 @@
 # Load and initialize
 source `dirname $0`/lib/httracker/functions || exit 1
 
+# Parameters
+DIRNAME="`dirname $0`"
+BASENAME="`basename $0`"
+
 # Other parameters
 SCUTTLEDIR="`basename $( find ${SCUTTLE_BASE} -maxdepth 1 -iname "SemanticScuttle-*" | head -n 1 )`"
 CONFIGFILE="${SCUTTLE_BASE}/${SCUTTLEDIR}/data/config.php"
diff --git a/webkit2png b/webkit2png
new file mode 160000 (submodule)
index 0000000..4a82a81
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 4a82a81cb0fd95faac721792951bd15ea82a11b9