1

I want to make a screenshot from another page on different domain/server and display it on the current page.

I thought to do it with an iframe but get problems with the viewport (doesn't fit the whole page in it, say 350px width). So I can't use canvas HTML5 because the solutions I found only make a screenshot of the current page.

I think I need to have something in PHP. I found some third-party service but I don't like it and don't want to use it.

The server is only a shared hosting server it's not a VPS so I can't install WebKit or PhantomJS on it. Does anybody have an idea what to do?

Nazim Kerimbekov
  • 4,712
  • 8
  • 34
  • 58
Janis
  • 53
  • 1
  • 7
  • 1
    https://www.url2png.com/ works fine and is quite cheap for the quality of service provided. It also has excellent code samples and documentation. All other options are out of your reach given your listed limitations. – Niels Keurentjes Sep 16 '14 at 21:11
  • Niels lees nog eens goed.. like I said don't wanna use 3de part service.. – Janis Sep 16 '14 at 21:18
  • I read your question just fine. As said, there are no non-3rd-party options if you can't install anything locally. Clientside code cannot break the iframe sandbox (thank god). I cannot answer your question, so I don't post an answer. I'm pointing you to the only viable solution via a comment. – Niels Keurentjes Sep 16 '14 at 21:20
  • @Janis Please use English, even if you know that you both are Dutch. – MC Emperor Sep 16 '14 at 21:21
  • but isn't there any php libary that works with curl and something like GD libary to make image out of it? – Janis Sep 16 '14 at 21:29
  • You truly expect a generic image manipulation library to emulate a fully CSS3-capable up to date webbrowser? Converting a URL to a website requires Webkit, Trident and Gecko millions of lines of code, which change all the time to match updated standards. That's why you either need a local render engine, based on Webkit or Gecko, or a remote SaaS solution like url2png or its many alternatives. – Niels Keurentjes Sep 19 '14 at 16:22

3 Answers3

1

Screen Web site screenshot tool based on PHP and PhanotomJS

You can use it to take screenshots for testing or monitoring service

Check this https://github.com/microweber/screen

JCPerez
  • 11
  • 1
0

conclusion:

This is not possible on shared hosting server with out a 3de part service

If you want to use PhantomJS or Webkit you need to have a VPS server or a server where you have root access to

Janis
  • 53
  • 1
  • 7
-1

You have to get gnome-web-photo. There are tools out there but you have to pay for it and it may or may not put ads or watermarks which i'm not sure if that's true but leaves questions up in the air.

At one of my position we were replicating features for www.mybloglog.com, it would take snapshot of your blog and store it in your profile to share, i think it got bought out by yahoo.

I tried many tools, I even utilized Fedora's X and that worked out well but lost the script that used to do that and I remember it not being that straight forward; I had to go through many different steps to take a webpage snapshot. You also had to make sure X was running.

Basically you need to install gnoe-web-photo by issuing for a better solution:

 sudo yum install gnome-web-photo - Fedora/Centos Server
 sudo apt-get install gnome-web-photo Debian Dist/Ubuntus

 gnome-web-photo -t 0 --mode=photo http://stackoverflow.com output.png 

Then you'll need to either create a server side script or a shell do trigger the command line above, you can obviously name your output .png to a specific name to your desire

Create a test bed and try it and see if that works for you.

unixmiah
  • 3,081
  • 1
  • 12
  • 26