Skip to content

Commit

Permalink
First commit with a chunck of code
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloacastillo committed Dec 27, 2019
1 parent 7ad2b5f commit 5a03b7b
Show file tree
Hide file tree
Showing 7 changed files with 456 additions and 0 deletions.
21 changes: 21 additions & 0 deletions composer.json
@@ -0,0 +1,21 @@
{
"name": "pabloacastillo/ruc-paraguay",
"description": "Fetch, search and retrieve RUC codes from the official taxes database from SET. Descargar, buscar y brindar información sobre los numeros de RUC desde la fuente oficial del SET en Paraguay.",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Pablo A. Castillo",
"email": "pabloacastillo@gmail.com"
}
],
"minimum-stability": "dev",
"require": {
"guzzlehttp/guzzle": "^6.5@dev"
},
"autoload":{
"psr-4":{
"pabloacastillo\\RUCParaguay\\":"src/"
}
}
}
298 changes: 298 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions src/Console/Commands/RUCParaguayCmd.php
@@ -0,0 +1,42 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class RUCParaguayCmd extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:name';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//
}
}
26 changes: 26 additions & 0 deletions src/Http/Controllers/RucpyController.php
@@ -0,0 +1,26 @@
<?php

namespace pabloacastillo\RUCParaguay\Http\Controllers;

use App\Http\Controllers\Controller;

class RucpyController extends Controller
{
//
protected $url='http://www.set.gov.py/rest/contents/download/collaboration/sites/PARAGUAY-SET/documents/informes-periodicos/ruc/';


public function Download(){
$storagePath = Storage::disk('local')->path('ruc-paraguay');
$client = new \GuzzleHttp\Client();

for($i=0;$i<=9;$i++){
$file_path='ruc'.$i.'.zip';
$URL = ($this->url).$file_path;
$client = new Client();

$response = $client->request('GET',$URL, ['save_to' => $storagePath.'/'.$file_path]);
}

}
}

0 comments on commit 5a03b7b

Please sign in to comment.