GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   I need a software that will turn a text list of urls (https://gfy.com/showthread.php?t=889970)

Sexxxy Sites 02-24-2009 08:21 PM

I need a software that will turn a text list of urls
 
into an indvidual html page for each url in the list. Does such an animal exist. I have google searched but have not as of yet found anything that will accomplish this.

Steve Awesome 02-24-2009 08:24 PM

Can you show what a few of the URLS in your "text list" look like?

What do you want on each page? The same thing? Or do you just want a directory structure created?

drocd 02-24-2009 08:24 PM

Hit me up and we can build a custom solution for you.

Sexxxy Sites 02-24-2009 08:30 PM

Quote:

Originally Posted by Steve Awesome (Post 15545352)
Can you show what a few of the URLS in your "text list" look like?

What do you want on each page? The same thing? Or do you just want a directory structure created?

Each line of the text list has a url and I want each url converted to an individual html page containing each single url. In other words if the text list has 300 urls I want the result to be 300 html pages.

fallenmuffin 02-24-2009 08:47 PM

Enjoy.

Code:

<?php

/* *************************
 * Fallen Muffin Media
 * http://www.fallenmuffin.com/
 ************************* */

$database = '/path/to/textfile.txt';
$path = '/path/to/html/files'; // no ending slash, make sure dir is chmod 777

/* ***************************
 * No modifications below this line
 *************************** */
$pieces = @file($database);
foreach ($pieces as $piece) {
        // get domain from url
        preg_match('@^(?:http://)?([^/]+)@i', $piece, $matches);
        $host = $matches[1];
        preg_match('/[^.]+\.[^.]+$/', $host, $matches);
        $domain = $matches[0];
        // data to write to html file
        $data = "<html><head><title>$domain</title></head><body><a href=\"$piece\">$domain</a></body></html>";
        // generate html file
        $fp = fopen($path.'/'.$domain.'.html', 'w');
        fwrite($fp, $data);
        fclose($fp);
}

?>


ExLust 02-24-2009 11:17 PM

fallenmuffin had it for you.

fallenmuffin 02-25-2009 12:48 PM

You're welcome...


All times are GMT -7. The time now is 01:59 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123