Help - Search - Members - Calendar
Full Version: Extracting URLs
Hydrogenaudio Forums > Misc. > Off-Topic
RiskyP
I have a list of URLs in a text file which all lead to a page with another single URL on them. How can I extract the URLs one level deeper and put them into a single text file?!

I don't know any scripting languages or anything, but any thoughts?! (This problem has been buggin the hell out of me).
justinj88
Download php.exe from http://www.php.net, and use a script like this:

CODE

<?php

$originalFile = 'file1.txt';
$newFile = 'file2.txt';


$h = fopen($newFile, 'w');
foreach(file($originalFile) as $this)
{
    $u = fopen($this, 'r');
    fwrite($h, fgets($u));
    fclose($u);
}
fclose($h);

?>


(I haven't tested the script, but it should work...)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.