From: Banana
Date: Sun, 16 Mar 2025 10:24:31 +0000 (+0100)
Subject: fixed whole page screenshot option.
X-Git-Tag: 2.9.0_20250316^2~1
X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=a7c1413f164f06bc91b2f31621a7654fa9c423b0;p=insipid.git
fixed whole page screenshot option.
Uses browserless.io. See documentation for more details
Signed-off-by: Banana
---
diff --git a/CHANGELOG b/CHANGELOG
index a3a96e1..0c52992 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,11 +4,11 @@ version 2.x.x - Griffin Chapel ()
+ Added new config settings for whole page screenshot creation. Please update your config.
See update.md for more details.
See whole-page-snapshot.md for more details.
- + Fixed: Snapshot json result from Google.
+ + Fixed whole page screenshot option. See documentation for more details.
+ + Removed page thumbnail creation.
+ New home screen layout
+ Better logging
+ Changed documentation files to markdown syntax.
- + Removed page thumbnail creation.
version 2.8.2 - Dragon Chapel (2023-09-14)
diff --git a/documentation/whole-page-snapshot.md b/documentation/whole-page-snapshot.md
index 8dcafd7..98c12ab 100644
--- a/documentation/whole-page-snapshot.md
+++ b/documentation/whole-page-snapshot.md
@@ -1,12 +1,12 @@
# Whole page screenshot of a website.
-It uses browserless.io to generate a whole page screenshot of a link.
+It uses `https://www.browserless.io/` to generate a whole page screenshot of a link.
There is a free account which allows ap to 1000 requests per month.
# Usage
To use this feature edit the `config.php` and set `COMPLETE_PAGE_SCREENSHOT` to `true`
-and provide your browserles.io API key to `COMPLETE_PAGE_SCREENSHOT_API_KEY`.
+and provide your browserles.io API key to `COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API_KEY`.
# Limitations and expectations
diff --git a/documentation/xml-export-and-import.md b/documentation/xml-export-and-import.md
index ed1ebec..bf6d76d 100644
--- a/documentation/xml-export-and-import.md
+++ b/documentation/xml-export-and-import.md
@@ -1,10 +1,10 @@
# XML import and export
-Any link can be exported as a xml file from the link info view. Login is required to trigger this function.
+Any link can be exported as an xml file from the link info view. Login is required to trigger this function.
The result can be used to import it again at the stats view.
-It exports all the link information, image and its tags and categories.
+It exports all the link information, but not the archive images.
The import can overwrite existing links and import non existing ones.
-A import xml file can contain multiple exports. Make sure the root is still there.
+A import xml file can contain multiple exports. Make sure the xml root is still there.
diff --git a/webroot/config.default.php b/webroot/config.default.php
index 9369d35..4746fa8 100644
--- a/webroot/config.default.php
+++ b/webroot/config.default.php
@@ -3,7 +3,7 @@
* Insipid
* Personal web-bookmark-system
*
- * Copyright 2016-2023 Johannes KeÃler
+ * Copyright 2016-2025 Johannes KeÃler
*
* Development starting from 2011: Johannes KeÃler
* https://www.bananas-playground.net/projekt/insipid/
@@ -84,7 +84,7 @@ const EMAIL_REPLY_BACK_SUBJECT = 'Insipid email import response';
# See whole-page-snapshot.txt for more details
const COMPLETE_PAGE_SCREENSHOT = false;
const COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API = "https://chrome.browserless.io/screenshot?token=";
-const COMPLETE_PAGE_SCREENSHOT_API_KEY = 'YOUR-API-KEY';
+const COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API_KEY = 'YOUR-API-KEY';
const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_TIMEOUT = 10000; # milliseconds
const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_IMAGE_QUALITY = 75; # quality for jpeg
diff --git a/webroot/lib/lang/eng.lang.ini b/webroot/lib/lang/eng.lang.ini
index eacc1ce..bb6e195 100644
--- a/webroot/lib/lang/eng.lang.ini
+++ b/webroot/lib/lang/eng.lang.ini
@@ -109,6 +109,8 @@ view.edit.categories = "Edit categories"
view.links = "Links"
view.random.headline = "Surprise"
view.random.link = "Link"
+view.pagescreenshot = "Full page screenshot"
+view.pagescreenshot.link = "View archived full page screenshot";
stats.view.all = "View all"
stats.moderation = "Moderation"
diff --git a/webroot/lib/lang/ger.lang.ini b/webroot/lib/lang/ger.lang.ini
index eb8258c..a35d287 100644
--- a/webroot/lib/lang/ger.lang.ini
+++ b/webroot/lib/lang/ger.lang.ini
@@ -109,6 +109,8 @@ view.edit.categories = "Kategorien bearbeiten"
view.links = "Links"
view.random.headline = "Ãberraschung"
view.random.link = "Link"
+view.pagescreenshot = "Full page screenshot"
+view.pagescreenshot.link = "View archived full page screenshot";
stats.view.all = "Alle"
stats.moderation = "Moderation"
diff --git a/webroot/lib/link.class.php b/webroot/lib/link.class.php
index 7d2f35c..73b0979 100644
--- a/webroot/lib/link.class.php
+++ b/webroot/lib/link.class.php
@@ -281,7 +281,6 @@ class Link {
Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
-
if ($query !== false) {
$catObj = new Category($this->DB);
$tagObj = new Tag($this->DB);
diff --git a/webroot/lib/snapshot.class.php b/webroot/lib/snapshot.class.php
index 41edb86..164eaf2 100644
--- a/webroot/lib/snapshot.class.php
+++ b/webroot/lib/snapshot.class.php
@@ -27,10 +27,9 @@
*/
/**
- * class Snapshot
- * create from given ULR a Screenshot for storage
- * right now it uses google pagespeedonline for a simple snapshot
- *
+ * Class Snapshot
+ * Create from given ULR a Screenshot for storage.
+ * Currently only browserless.io is supported.
*
*/
class Snapshot {
@@ -82,7 +81,7 @@ class Snapshot {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 2);
- // DEBUG ONLY
+ // manual DEBUG ONLY
//$curl_log = fopen(ABSOLUTE_PATH."/curl.log", 'w');
//curl_setopt($ch, CURLOPT_VERBOSE, true);
//curl_setopt($ch, CURLOPT_STDERR, $curl_log);
@@ -96,7 +95,7 @@ class Snapshot {
if(DEBUG) Summoner::sysLog("DEBUG return ".Summoner::cleanForLog($do));
- // DEBUG ONLY
+ // manual DEBUG ONLY
//fclose($curl_log);
$ret = true;
diff --git a/webroot/view/linkinfo.php b/webroot/view/linkinfo.php
index 2e65243..e69802f 100644
--- a/webroot/view/linkinfo.php
+++ b/webroot/view/linkinfo.php
@@ -75,6 +75,20 @@
+
+
+
+
+ t('view.pagescreenshot'); ?>
+
+
+
+
+