|
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.
[Back to original message]
|