๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #253

Re: Leer sitio web desde php

#253
From: Marious
Date: Mon, 05 Oct 2009 23:32
40 lines
2724 bytes
On 10/05/2009 04:29 PM, Daniel V wrote:
> In chile.comp.unix Marious<sinspam@tampocoexiste.ivn.cl>  wrote:
>> On 10/03/2009 01:33 PM, +mArkO+ wrote:
>>> Estimados, necesito leer un contenido de un sitio web con un script en php
>>> que hice. intent? con fopen y con file, pero con un sitio en especifico no
>>> me funciona y se llega al maximo tiempo de ejecucion sin obtener resultados.
>>> (el sitio web desde el navegador puedo verlo sin problemas)
>>>
>>> ?a que se deber? esto?
>>> ?alguna sugerencia para lograrlo?
>>>
>>> gracias
>>>
>>>
>>>
>>
>> Utiliza libCurl
>> http://cl.php.net/curl
>
> Estimados,
>
> Alguna vez tuve un problema similar, y resulto ser que el servidor donde
> estaba alojado no permitia hacer estas llamadas remotas.
> (no recuerdo si probe con fopen o libCurl, pero nada funcionaba...)
> Instale el script en un servidor con menos restricciones y todo funciono
> ok.., asi que yo probaria lo mismo en otro lado para descartar que el
> servidor te este bloqueando la llamada.
>
> Saludos,
> Daniel
>

Para que fopen lea un documento remoto, php debe tener habilitado
allow_url_fopen.

Para que libCurl funcione debe... estar instalado libCurl.

Si el servidor no tiene ninguna de esas no se podrรก hacer. la gracia
de usar libCurl es que puedo enviar postdata, y falsear mi user-agent
http header para pasar por una visita cualquiera ante el otro servidor.
Technical Details
Message-ID: <hadvn8$abi$1@news.nivel5.cl>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!novia!border2.nntp.dca.giganews.com!nntp.giganews.com!xen.linfati.cl!news.nivel5.cl!not-for-mail
References: <ha81sl$j02$1@news.nivel5.cl> <ha8pvk$l25$1@news.nivel5.cl> <hadkuc$2l9$1@helcaraxe.dcc.uchile.cl>

Show Full Headers
Complete Article Headers
X-Google-Thread: e499fe1f24,8a5a386a78263e0b
X-Google-Attributes: gide499fe1f24,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: SPANISH,UTF8
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!novia!border2.nntp.dca.giganews.com!nntp.giganews.com!xen.linfati.cl!news.nivel5.cl!not-for-mail
From: Marious <sinspam@tampocoexiste.ivn.cl>
Newsgroups: chile.comp.programacion,chile.comp.unix,chile.comp.www
Subject: Re: Leer sitio web desde php
Date: Mon, 05 Oct 2009 19:32:54 -0400
Organization: Varios
Lines: 40
Message-ID: <hadvn8$abi$1@news.nivel5.cl>
References: <ha81sl$j02$1@news.nivel5.cl> <ha8pvk$l25$1@news.nivel5.cl> <hadkuc$2l9$1@helcaraxe.dcc.uchile.cl>
NNTP-Posting-Host: pc-32-10-104-200.cm.vtr.net
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.nivel5.cl 1254785576 10610 200.104.10.32 (5 Oct 2009 23:32:56 GMT)
X-Complaints-To: news@news.nivel5.cl
NNTP-Posting-Date: Mon, 5 Oct 2009 23:32:56 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11
In-Reply-To: <hadkuc$2l9$1@helcaraxe.dcc.uchile.cl>