plugin:snap
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:snap [2010-03-03 11:37] – 145.242.11.3 | plugin:snap [2017-11-25 21:09] (current) – Aleksandr | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: Displays a site as a snapshot (fr: Affiche un site sous forme de miniature) |
author | author | ||
email : emauvaisfr@yahoo.fr | email : emauvaisfr@yahoo.fr | ||
Line 13: | Line 13: | ||
tags : media, images, links | tags : media, images, links | ||
- | ^downloadurl: | + | downloadurl: |
bugtracker : | bugtracker : | ||
sourcerepo : | sourcerepo : | ||
Line 20: | Line 20: | ||
===== Description ===== | ===== Description ===== | ||
+ | |||
* helper: do the snapshot of a given URL (DokuWiki page ID or full URL). View [[# | * helper: do the snapshot of a given URL (DokuWiki page ID or full URL). View [[# | ||
* syntax: calls the helper to insert a snapshot into your pages using an [[# | * syntax: calls the helper to insert a snapshot into your pages using an [[# | ||
Line 26: | Line 27: | ||
===== Requirements ===== | ===== Requirements ===== | ||
+ | |||
* This plugin will only work on Linux (not the plugin itself, but the snapshot server...) | * This plugin will only work on Linux (not the plugin itself, but the snapshot server...) | ||
- | * The whole snap process was tested on a Debian distribution | + | * The whole snap process was tested on a Debian distribution |
* Tell me if you make it work on a Windows box (or another)! | * Tell me if you make it work on a Windows box (or another)! | ||
* Use it at your own risks! ;-) | * Use it at your own risks! ;-) | ||
Line 33: | Line 35: | ||
* This may not be possible if your DokuWiki is hosted... | * This may not be possible if your DokuWiki is hosted... | ||
- | * Softwares | + | * Software |
* '' | * '' | ||
* See http:// | * See http:// | ||
* '' | * '' | ||
- | * See http:// | + | * See [[wp>Xvfb]] |
* '' | * '' | ||
* See http:// | * See http:// | ||
Line 43: | Line 45: | ||
* Software needed to set up the snap server: | * Software needed to set up the snap server: | ||
* '' | * '' | ||
- | * See http:// | + | * See [[wp>Netcat]] |
* See [[# | * See [[# | ||
Line 49: | Line 51: | ||
===== How it works? ===== | ===== How it works? ===== | ||
+ | |||
* Some modules are needed to do the snapshot: | * Some modules are needed to do the snapshot: | ||
- A snapshot server ('' | - A snapshot server ('' | ||
Line 62: | Line 65: | ||
* Why is it so complicated? | * Why is it so complicated? | ||
- | * Because when you try to call '' | + | * Because when you try to call '' |
- | * After the snapshot, the snap image is available as a '' | + | * After the snapshot, the snap image is available as a '' |
- | * The name of this file keeps track of the url that was "snaped" and the snap size (ex: '' | + | * The name of this file keeps track of the URL that was "snapped" and the snap size (ex: '' |
* A snap cache mechanism is used to avoid generating a snapshot over and over. If the snap is found on the drive, having the same dimensions and not too old (regarding '' | * A snap cache mechanism is used to avoid generating a snapshot over and over. If the snap is found on the drive, having the same dimensions and not too old (regarding '' | ||
===== Important ===== | ===== Important ===== | ||
+ | |||
* Be aware that people can read snap of pages they may not have right to access (this is due to snap caching). However, the snap is normally small enough to prevent a comfortable reading ;-) | * Be aware that people can read snap of pages they may not have right to access (this is due to snap caching). However, the snap is normally small enough to prevent a comfortable reading ;-) | ||
- | * If your DokuWiki is not open for reading to everyone (use of authentication), | + | * If your DokuWiki is not open for reading to everyone (use of authentication), |
- | * It is recommended to use [[: | + | * It is recommended to use [[: |
* By now, the snap server and the DokuWiki server have to be on the same computer. | * By now, the snap server and the DokuWiki server have to be on the same computer. | ||
* A next version will try to make it possible to have separate computers. | * A next version will try to make it possible to have separate computers. | ||
Line 79: | Line 83: | ||
===== Installation ===== | ===== Installation ===== | ||
- | | + | |
+ | | ||
==== html2image ==== | ==== html2image ==== | ||
+ | |||
* As user '' | * As user '' | ||
* Configure the proxy options into '' | * Configure the proxy options into '' | ||
Line 92: | Line 98: | ||
==== Xvfb ==== | ==== Xvfb ==== | ||
+ | |||
* Verify if '' | * Verify if '' | ||
* If not: '' | * If not: '' | ||
Line 97: | Line 104: | ||
==== Test if html2image is working ==== | ==== Test if html2image is working ==== | ||
+ | |||
* Run '' | * Run '' | ||
* Define the DISPLAY variable: '' | * Define the DISPLAY variable: '' | ||
Line 104: | Line 112: | ||
==== netcat ==== | ==== netcat ==== | ||
+ | |||
* Verify that '' | * Verify that '' | ||
* If not: '' | * If not: '' | ||
==== convert ==== | ==== convert ==== | ||
+ | |||
* Verify that '' | * Verify that '' | ||
* If not: '' | * If not: '' | ||
Line 113: | Line 123: | ||
==== snap plugin ==== | ==== snap plugin ==== | ||
+ | |||
* Use the Plugin Manager to install the snap plugin (see download at the top of this page). | * Use the Plugin Manager to install the snap plugin (see download at the top of this page). | ||
===== Configuration ===== | ===== Configuration ===== | ||
+ | |||
* Still as user '' | * Still as user '' | ||
* Create this directory ''/ | * Create this directory ''/ | ||
Line 128: | Line 140: | ||
==== Test ==== | ==== Test ==== | ||
+ | |||
* Add this into your playground page: < | * Add this into your playground page: < | ||
- | * → The snapshot must appear. | + | * -> The snapshot must appear. |
- | + | ||
===== Syntax ===== | ===== Syntax ===== | ||
+ | |||
* Like a link (''< | * Like a link (''< | ||
* The site url can be a " | * The site url can be a " | ||
Line 148: | Line 160: | ||
===== Notes ===== | ===== Notes ===== | ||
+ | |||
* The default snap size is 200x150 pixels. | * The default snap size is 200x150 pixels. | ||
* There are also maxWidth and maxHeight parameters to avoid too big snaps (400x300). | * There are also maxWidth and maxHeight parameters to avoid too big snaps (400x300). | ||
Line 154: | Line 167: | ||
===== Helper reference ===== | ===== Helper reference ===== | ||
+ | |||
* The getSnap() function is used to do the snapshot of a site. | * The getSnap() function is used to do the snapshot of a site. | ||
* Parameters: | * Parameters: | ||
- | * Url to snap or DokuWiki page ID (required) | + | * URL to snap or DokuWiki page ID (required) |
* Snap width (optional) | * Snap width (optional) | ||
* Snap height (optional) | * Snap height (optional) | ||
Line 164: | Line 178: | ||
* Returns an array with: | * Returns an array with: | ||
* The path and name of the snapshot. | * The path and name of the snapshot. | ||
- | * The page title (if a DokuWiki page id was submited). | + | * The page title (if a DokuWiki page id was submitted). |
- | * The target frame for the link to the "snaped" site. | + | * The target frame for the link to the "snapped" site. |
* All the snap object properties are also available (see below). | * All the snap object properties are also available (see below). | ||
Line 198: | Line 212: | ||
[snapPorts] => 8888 8889 8890 8891 8892 //Snap server port(s). | [snapPorts] => 8888 8889 8890 8891 8892 //Snap server port(s). | ||
[snapTimeout] => 5 //Max duration for a snap (seconds). | [snapTimeout] => 5 //Max duration for a snap (seconds). | ||
- | [tryTimeout] => 3 //Max retries to connect snap serveur. | + | [tryTimeout] => 3 //Max retries to connect snap server. |
[checkCache] => 1 //Use snap cache (true/ | [checkCache] => 1 //Use snap cache (true/ | ||
[width] => 200 // | [width] => 200 // | ||
Line 220: | Line 234: | ||
Output image :/ | Output image :/ | ||
content size: | content size: | ||
- | Convert | + | Convert |
Resize 200 | Resize 200 | ||
Crop 200x150+0+0 | Crop 200x150+0+0 | ||
Line 228: | Line 242: | ||
//Can be greater than the snap duration itself if more than one retry was done to connect the snap server. | //Can be greater than the snap duration itself if more than one retry was done to connect the snap server. | ||
[tries] => 1 // | [tries] => 1 // | ||
- | [url] => http:// | + | [url] => http:// |
//Inherited properties ------------------------------------------------------------------------------------------ | //Inherited properties ------------------------------------------------------------------------------------------ | ||
Line 249: | Line 263: | ||
===== Version history ===== | ===== Version history ===== | ||
+ | |||
* 2008-10-17: first one! | * 2008-10-17: first one! | ||
===== Discussion ===== | ===== Discussion ===== | ||
+ | |||
* Tell me... | * Tell me... | ||
plugin/snap.txt · Last modified: 2017-11-25 21:09 by Aleksandr