Skip to content

Server written in Perl which uses webkit2png to take screenshots of webpages.

License

Notifications You must be signed in to change notification settings

rgglez/webkit2png-daemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

webkit2png-daemon

License GitHub issues GitHub commit activity

A server daemon written in Perl which listens in an specified TCP port for a string containing the URL to be screenshoted. It uses the WebKit2PNG script to make the screenshot.

You can configure the listening port, host and other parameters for the daemon using the Net::Server configuration. See the run.sh script for an example on how to run the daemon.

Usage

Adjust the paths of the programs here:

my $PYTHON = '/usr/bin/python';
my $XVFB = '/usr/bin/xvfb-run';
my $WEBKIT2PNG = 'webkit2png.py';
my $CAT = '/bin/cat';

Create the directory for the logs and set the correct permissions/ownerships:

mkdir /var/log/webkit2png/
chown $USER:$GROUP /var/log/webkit2png/

Start the server executing:

perl WebKit2PNGDaemon.pl

Then send a string (the URL to be screenshoted) to the specified port and host. The server will execute WebKit2PNG and return a first line containing

LENGTH: <length of the captured image in bytes>

and then the bytes of the captured screen in PNG format, or an error image.

Dependencies

Perl modules

You can install them using perl -MCPAN -e shell or your distro's package manager:

Programs

Notes

  • You must download the webkit2png Python script.
  • If you are into cloud FaaS, look here.

License

Copyright (c) 2023, Rodolfo González González.

Read the LICENSE file.

About

Server written in Perl which uses webkit2png to take screenshots of webpages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published