Skip to content

Instantly share code, notes, and snippets.

@jleonardolemos
Created May 19, 2017 19:25
Show Gist options
  • Save jleonardolemos/a0c4b2cfe916100245ce72dccc8f466b to your computer and use it in GitHub Desktop.
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
<?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