You are here: Re: A fast alternative to HTTP::head ? « PHP Programming Language « IT news, forums, messages
Re: A fast alternative to HTTP::head ?

Posted by shimmyshack on 06/23/07 08:35

On Jun 23, 6:17 am, Ming <minghu...@gmail.com> wrote:
> I have tens of thousands of links. All links will redirect visitors to
> another URL (the real URL). I want to know the real URLs behind those
> redirecting URLs.
>
> I just wrote a small piece of code to do it:
>
> $result = HTTP::head($link);
> if (PEAR::isError($result)) {
> echo "Error: " . $result->getMessage()."<br>";
> } else {
> $chunks=split('%2F',$result['Location']);
> echo "\t".$chunks['2'].'<br>';
> }
>
> It works, but it is simply too slow to get the real (destination) URLs
> for tens of thousands of redirecting URLs.
>
> Is there a fast way to do that?
>
> Thanks,

php doesn't seem your best bet unless you run the code multiple times
simultaneously to simulate multiple threads.
what OS are you using? divide up the workload into 20 and run 20
copies of the code, or 9 if you are xp sp2.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация