Artisan command to initiaite redownload of webmention’s HTML
This commit is contained in:
parent
9aef3c6334
commit
bd6af02170
1 changed files with 47 additions and 0 deletions
47
app/Console/Commands/DownloadWebMentions.php
Normal file
47
app/Console/Commands/DownloadWebMentions.php
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\WebMention;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use App\Jobs\DownloadWebMention;
|
||||||
|
|
||||||
|
class DownloadWebMentions extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'webmentions:download';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Redownload the HTML content of webmentions';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$webmentions = WebMention::all();
|
||||||
|
foreach ($webmentions as $webmention) {
|
||||||
|
$this->dispatch(new DownloadWebMention($webmention->source));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue