Setup CloudConvert to take webpage screenshots
This commit is contained in:
parent
0d393bd172
commit
45c71bbb47
7 changed files with 177 additions and 38 deletions
|
@ -20,8 +20,7 @@ class ProcessBookmark implements ShouldQueue
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
/** @var Bookmark */
|
||||
protected $bookmark;
|
||||
protected Bookmark $bookmark;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
|
@ -38,14 +37,13 @@ class ProcessBookmark implements ShouldQueue
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$uuid = (resolve(BookmarkService::class))->saveScreenshot($this->bookmark->url);
|
||||
$this->bookmark->screenshot = $uuid;
|
||||
SaveScreenshot::dispatch($this->bookmark);
|
||||
|
||||
try {
|
||||
$archiveLink = (resolve(BookmarkService::class))->getArchiveLink($this->bookmark->url);
|
||||
} catch (InternetArchiveException $e) {
|
||||
} catch (InternetArchiveException) {
|
||||
$archiveLink = null;
|
||||
}
|
||||
$this->bookmark->archive = $archiveLink;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue