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 want to switch out one url on 500 html pages with multiple urls at random, can I? (https://gfy.com/showthread.php?t=677689)

Jace 11-15-2006 08:01 PM

I want to switch out one url on 500 html pages with multiple urls at random, can I?
 
I have about 500 html pages, they all have the same url throughout them

I have list of alternate urls that I want that one url switched out for, at random

so, every html page will have different links, but keeping within the 10 or so links that I provide...and all random

is there a script or software that can do that?

StarkReality 11-15-2006 08:11 PM

Useful File Utilities from http://www.replsoft.com/ is good for batch replacing in html files, but you'd need to put the files in 10 directories/50 files each since it has no randomizing function...but still less work than doing it one by one.

Jace 11-15-2006 08:15 PM

Quote:

Originally Posted by StarkReality (Post 11323808)
Useful File Utilities from http://www.replsoft.com/ is good for batch replacing in html files, but you'd need to put the files in 10 directories/50 files each since it has no randomizing function...but still less work than doing it one by one.

what if the url that i want replaced is at 20 times in one html document, can I set it to put my 10 urls at random in that one html page?

marketsmart 11-15-2006 08:17 PM

im not sure, but heres a bump

r-c-e 11-15-2006 08:24 PM

Perhaps a perl or php script might help.

fris 11-15-2006 08:25 PM

write a random function

$file = "urls.txt";
$fp = file($file);
srand((double)microtime()*1000000);
$urls = $fp[array_rand($fp)];
echo $urls;

could do that and call it from

<a href="<?include "random.php"?>">

and if they must be .html pages you could add to .htaccess

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html .inc

dont know if thats what you are looking for or not

SmokeyTheBear 11-15-2006 08:25 PM

i just did this recently for someone. i'm a but busy tonight but keep in touch and i can help you out if you dont find anything

GooSearch 11-15-2006 08:27 PM

have you tried dreamweavers find and replace..i have done 230 pages.. nothign random though sry

SmokeyTheBear 11-15-2006 08:27 PM

Quote:

Originally Posted by Fris (Post 11323897)
write a random function

$file = "urls.txt";
$fp = file($file);
srand((double)microtime()*1000000);
$urls = $fp[array_rand($fp)];
echo $urls;

could do that and call it from

<a href="<?include "random.php"?>">

and if they must be .html pages you could add to .htaccess

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html .inc

dont know if thats what you are looking for or not

good solution , only problem is the links would be spidered as random as well ( although that might be better )

i.e. for seo purposes it might be better for them to be randomly placed but stay static

BV 11-15-2006 08:30 PM

you might be able to do a search and replace and replace the said URL with an include tag of some sort. (php. cgi etc..) and let it include your other urls at random.

Jace 11-15-2006 08:32 PM

Quote:

Originally Posted by Fris (Post 11323897)
write a random function

$file = "urls.txt";
$fp = file($file);
srand((double)microtime()*1000000);
$urls = $fp[array_rand($fp)];
echo $urls;

could do that and call it from

<a href="<?include "random.php"?>">

and if they must be .html pages you could add to .htaccess

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html .inc

dont know if thats what you are looking for or not

you know, that might actually work better, cause then the page would be changing constantly

Jace 11-15-2006 08:32 PM

Quote:

Originally Posted by SmokeyTheBear (Post 11323914)
good solution , only problem is the links would be spidered as random as well ( although that might be better )

i.e. for seo purposes it might be better for them to be randomly placed but stay static

yeah,i was thinking that too...not a bad idea :)

OzMan 11-15-2006 08:33 PM

time machine and includes would be your best bet :winkwink:

I haven't seen any batch search and replace program that will pull randomly from a file so I think you gotta go the script route

Thurbs 11-15-2006 08:38 PM

serverside it can be done with a simple command line if ur handy in lin :)

SmokeyTheBear 11-15-2006 08:39 PM

Quote:

Originally Posted by OzMan (Post 11323953)
time machine and includes would be your best bet :winkwink:

I haven't seen any batch search and replace program that will pull randomly from a file so I think you gotta go the script route


I made a custom one that will do all subs etc , just its actually more intensive than jace needs.. mine actually reads each html page and detects the pages main keywords and attempts to match and replace links with other appropriate links

Jace 11-15-2006 08:43 PM

Quote:

Originally Posted by SmokeyTheBear (Post 11323994)
I made a custom one that will do all subs etc , just its actually more intensive than jace needs.. mine actually reads each html page and detects the pages main keywords and attempts to match and replace links with other appropriate links

woah

is that server side or desktop app?

SmokeyTheBear 11-15-2006 08:47 PM

ok i just recoded mine to do what you want icq me

SmokeyTheBear 11-15-2006 08:55 PM

Quote:

Originally Posted by Jace (Post 11324034)
woah

is that server side or desktop app?

server but i could do both

SlamDesigns 11-15-2006 09:13 PM

Quote:

Originally Posted by SmokeyTheBear (Post 11324115)
server but i could do both

This isn't meant to sound sarcastic, I am 100% sincere...are you a fucking genius? I've seen a few posts about your coding and all I can say is WOW! I do well to mess with basic HTML and PHP...but what you do...WOW!

woj 11-15-2006 09:17 PM

if you still need a solution, and are looking to invest a few bucks, hit me up, icq: 33375924

Kimo 11-15-2006 09:40 PM

hope you got it fixed, i said fuck it and went through about 100 pages the other day to replace urls


All times are GMT -7. The time now is 06:58 AM.

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