🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #1699

Re: Obtener Raz?n Social a partir de un RUT??

#1699
From: Mauricio Vergara Ereche
Date: Tue, 27 Jun 2006 13:43
34 lines
2111 bytes
Hector Vergara R. <hvergara@es-gmail.com> wrote:
> Si usas PHP, puedes usar esto, si no, puedes copiar la idea a otro
> lenguaje. (me van a _linchar_ los del NIC):

No se te linchar�...
pero s� est�s dando una soluci�n parcelada. 

Con alrededor de _s�lo_ 75.000 ruts, no creo que puedas tener una aplicaci�n
"robusta".

Sugiero que utilicen los medios que provee el SII para obtener esta
informaci�n de manera correcta y segura.

> <?php
> function getRazonSocial($rut, $dv) {
>
>         $url = "http://www.nic.cl/cgi-bin/ingresa-solicitud?rut=
> {$rut}&dv={$dv}&emailr=foo@bar.com&dominio=bar.com&pantalla=2&opcode=C"; 
>         $data = file_get_contents($url);
>
>         $pattern = "/<td>Nombre del titular:<\/td><td>(.+?)&nbsp;/";
>         preg_match($pattern, $data, $matches);
>
>         return empty($matches)?false:trim($matches[1]);
> }
>
> ?>

Saludos!


-- 
Mauricio Vergara Ereche                           mave [@] nic [.] cl
counter.li.org: #188365
Technical Details
Message-ID: <e7rclv$jpv$1@manutara.inf.utfsm.cl>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news.nivel5.cl!news.inf.utfsm.cl!not-for-mail
References: <e7c3fr$2oj$1@proxy.ifxnw.cl> <e7iir0$77s$1@news.nivel5.cl>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,4d2ffd5e05940cdf
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!nntp-server.pubsub.com!news.nivel5.cl!news.inf.utfsm.cl!not-for-mail
From: "Mauricio Vergara Ereche" <mave@sacaesto.nic.cl>
Newsgroups: chile.comp.programacion
Subject: Re: Obtener Raz?n Social a partir de un RUT??
Date: Tue, 27 Jun 2006 13:43:27 +0000 (UTC)
Organization: Depto. de Informatica, UTFSM.
Lines: 34
Sender: Mauricio Vergara Ereche <mave007@sanroque.inf.utfsm.cl>
Message-ID: <e7rclv$jpv$1@manutara.inf.utfsm.cl>
References: <e7c3fr$2oj$1@proxy.ifxnw.cl> <e7iir0$77s$1@news.nivel5.cl>
NNTP-Posting-Host: sanroque.inf.utfsm.cl
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: manutara.inf.utfsm.cl 1151415807 20287 200.1.19.161 (27 Jun 2006 13:43:27 GMT)
X-Complaints-To: newsadmin@inf.utfsm.cl
NNTP-Posting-Date: Tue, 27 Jun 2006 13:43:27 +0000 (UTC)
User-Agent: tin/1.7.9-20050629 ("Grimsay") (UNIX) (Linux/2.6.16-1.2115_FC4 (i686))