Created
May 19, 2017 19:25
-
-
Save jleonardolemos/a0c4b2cfe916100245ce72dccc8f466b to your computer and use it in GitHub Desktop.
gera um html com conteúdo do iframe e faz upload no ftp do portal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use GuzzleHttp\Client; | |
class Iframe extends Command | |
{ | |
/** | |
* The name and signature of the console command. | |
* | |
* @var string | |
*/ | |
protected $signature = 'iframe'; | |
/** | |
* The console command description. | |
* | |
* @var string | |
*/ | |
protected $description = 'Gera e copia o iframe via ftp'; | |
/** | |
* Execute the console command. | |
* | |
* @return mixed | |
*/ | |
public function handle() | |
{ | |
file_put_contents( | |
storage_path('iframe.html'), | |
app()->make(Client::class) | |
->request('GET', 'http://diarioimoveis.com.br/iframe') | |
->getBody() | |
); | |
exec('curl -T ' . storage_path('iframe.html') . ' ftp://user:pass@server/path'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment