🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #1691

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

#1691
From: Hector Vergara R.
Date: Sat, 24 Jun 2006 05:33
51 lines
2397 bytes
Si usas PHP, puedes usar esto, si no, puedes copiar la idea a otro lenguaje.
(me van a _linchar_ los del NIC):

<?php

/*
    Retorna FALSE en caso de ERROR o si no encuentra la Razon Social.

    Ejemplo de Uso:
    $razon_social = getRazonSocial(12345678,9);
*/

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]);
}

?>


Espero que te sirva, saludos!



"digital" <avasquenNOSPAM@NOSPAMpuc.cl> escribi� en el mensaje 
news:e7c3fr$2oj$1@proxy.ifxnw.cl...
> Estoy desarrollando una aplicaci�n y me baj� la duda...
>
> �Existe alguna manera de obtener el nombre o raz�n social de una empresa a 
> partir de su RUT?
>
> Tal como lo hace NIC Chile cuando registras un dominio, en que te pide el 
> RUT y autom�ticamente obtiene la raz�n social asociada a ese RUT.
>
> Estuve buscando en el SII y en otras instituciones p�blicas sobre alg�n 
> servicio de consulta o Web Service que provea esta informaci�n, pero no he 
> encontrado nada.
>
> �Alguien tiene alguna pista de si es posible hacerlo, usando fuentes 
> p�blicas?
>
> ---
> Alejandro
> 
Technical Details
Message-ID: <e7iir0$77s$1@news.nivel5.cl>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!not-for-mail
References: <e7c3fr$2oj$1@proxy.ifxnw.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!news3.google.com!news.glorb.com!news.kjsl.com!news.nivel5.cl!not-for-mail
From: "Hector Vergara R." <hvergara@es-gmail.com>
Newsgroups: chile.comp.programacion
Subject: Re: Obtener Raz�n Social a partir de un RUT??
Date: Sat, 24 Jun 2006 01:33:16 -0400
Organization: Varios
Lines: 53
Message-ID: <e7iir0$77s$1@news.nivel5.cl>
References: <e7c3fr$2oj$1@proxy.ifxnw.cl>
NNTP-Posting-Host: pc-75-16-83-200.cm.vtr.net
X-Trace: news.nivel5.cl 1151127200 7420 200.83.16.75 (24 Jun 2006 05:33:20 GMT)
X-Complaints-To: news@news.nivel5.cl
NNTP-Posting-Date: Sat, 24 Jun 2006 05:33:20 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Response