Save an archive link of bookmarks
This commit is contained in:
parent
7688bb51d9
commit
917a673f05
2 changed files with 3 additions and 3 deletions
|
@ -46,8 +46,8 @@ class ProcessBookmark implements ShouldQueue
|
||||||
//get an internet archive link
|
//get an internet archive link
|
||||||
$response = $client->request('GET', 'https://web.archive.org/save/' . $this->bookmark->url);
|
$response = $client->request('GET', 'https://web.archive.org/save/' . $this->bookmark->url);
|
||||||
if ($response->hasHeader('Content-Location')) {
|
if ($response->hasHeader('Content-Location')) {
|
||||||
if (starts_with($response->getHeader('Content-Location'), '/web')) {
|
if (starts_with($response->getHeader('Content-Location')[0], '/web')) {
|
||||||
$this->bookmark->archive = $response->getHeader('Content-Location');
|
$this->bookmark->archive = $response->getHeader('Content-Location')[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class CreateBookmarksTable extends Migration
|
||||||
$table->string('name')->nullable();
|
$table->string('name')->nullable();
|
||||||
$table->text('content')->nullable();
|
$table->text('content')->nullable();
|
||||||
$table->uuid('screenshot')->nullable();
|
$table->uuid('screenshot')->nullable();
|
||||||
$table->string('archve')->nullable();
|
$table->string('archive')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue