Save an archive link of bookmarks

This commit is contained in:
Jonny Barnes 2017-10-13 13:06:51 +01:00
parent 7688bb51d9
commit 917a673f05
2 changed files with 3 additions and 3 deletions

View file

@ -46,8 +46,8 @@ class ProcessBookmark implements ShouldQueue
//get an internet archive link
$response = $client->request('GET', 'https://web.archive.org/save/' . $this->bookmark->url);
if ($response->hasHeader('Content-Location')) {
if (starts_with($response->getHeader('Content-Location'), '/web')) {
$this->bookmark->archive = $response->getHeader('Content-Location');
if (starts_with($response->getHeader('Content-Location')[0], '/web')) {
$this->bookmark->archive = $response->getHeader('Content-Location')[0];
}
}

View file

@ -19,7 +19,7 @@ class CreateBookmarksTable extends Migration
$table->string('name')->nullable();
$table->text('content')->nullable();
$table->uuid('screenshot')->nullable();
$table->string('archve')->nullable();
$table->string('archive')->nullable();
$table->timestamps();
});
}