S
S
Sergey Titov2015-09-27 13:24:05
PHP
Sergey Titov, 2015-09-27 13:24:05

How to get a site image?

I make visual bookmarks and the question arose, how to get the image of the site by the link?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Novikov, 2015-09-27
@dmitriy_novikov

for example, you can use the api service s-shot.ru

I
IvanSenishin, 2015-09-27
@IvanSenishin

Option 1
Option 2

$img = file_get_contents('http://www.example.com/');
if ($img) {
  file_put_contents($file, $img);
}

X
xmoonlight, 2015-09-27
@xmoonlight

Use phantom.js out of the box there is a script in the examples.
Run from the command line (CLI) and the shot is ready.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question