dev-master
9999999-dev http://codegyre.comPHP tool to make web-shots using PhantomJS
MIT
The Requires
- php >=5.3.3
by Nick Palamarchuk
screenshot webshot pageshot
Wallogit.com
2017 © Pedro Peláez
PHP tool to make web-shots using PhantomJS
PHP tool to make web-shots using PhantomJS, (*1)
"require": {
"codegyre/phantomshot": "dev-master"
}
"scripts": {
"post-install-cmd": [
"Codegyre\\PhantomShot\\ComposerHook::hook"
],
"post-update-cmd": [
"Codegyre\\PhantomShot\\ComposerHook::hook"
]
}
We need this to install required dependencies through npm., (*2)
$webPage = new \Codegyre\PhantomShot\WebPage('http://github.com');
$webPage->getShot('/tmp/github.png');
$tc = new \Codegyre\PhantomShot\ThumbnailCollector('http://github.com');
$tc->createThumbnail('/destination/dir/1.png', 200, 400, ThumbnailCollector::TRANSFORM_FILL_HEIGHT_MIDDLE);
$tc->createThumbnail('/destination/dir/1.png', 350, 160, ThumbnailCollector::TRANSFORM_FILL_WIDTH_MIDDLE);
Make sure you have npm installed on your system, (*3)
You have a possibility to use phantomshot as a web service to get website screenshots, (*4)
cd src/js && ./phantomshot-service.js --port=3000
It will start http server on localhost:3000. Usage:, (*5)
http://localhost:3000/?width=1024&height=768&url=http://example.com
PHP tool to make web-shots using PhantomJS
MIT
screenshot webshot pageshot