![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jan 2003
Posts: 3,852
|
Programmers, how can I do this?
I want to use CityDesk, a desktop content management program:
http://www.fogcreek.com/CityDesk/ to manage some static HTML freesites. However CityDesk adds a metatag to all pages which I want to get rid of. I could publish the pages locally, do a search and replace, then upload to the servers. But it would be MUCH more efficient to do an automated search and replace on the servers. Would it be difficult to write a server-side script that deletes the metatag from all pages, bearing in mind that these pages will published across multiple domains and multiple virtual hosts? Also please note that I'd prefer to run the script on demand rather than as a CRON job. If this is something that you could write for me, please describe your proposed solution and provide a ballpark cost. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Jan 2003
Posts: 3,852
|
Bump
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
download the stuff...multifile replace and upload the stuff.
But arent those pages generated on the fly...meaning they would have to modify there script?
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
im downloading the demo now to see what the options are.
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
see what you mean
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Feb 2004
Location: Ohio, US
Posts: 662
|
Your best bet's probably a perl script you can run via cgi, to go through the files, and use a regex on each one. If you want me to do it, you'll have to get ahold of our sales guy:
AIM: Avanteguard MSN: matt [ at ] imadigan.com Email: matt [ at ] imadigan.com ICQ: 314942262 and he'll take care of you. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Oct 2002
Location: Toronto
Posts: 346
|
^^^ exactly what he said, this would be your best bet.. but you would still have to run the script everytime you want to update it. unless you put the script on a timer ;)
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
|
If you're in UNIX, you can just have a script using "rep" on files you upload.
If Windows, I dunno maybe a .bat file?
__________________
Skype variuscr - Email varius AT gmail |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Jan 2003
Posts: 3,852
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
|
Quote:
1 - crontab script, but you said you wanted to avoid that 2 - get your server to execute a script whenever 'x' is uploaded. Probably the most complicated as you have to hack some sources and recompile stuff. 3 - have script you run manually. Just make a super easy shell script that will execute rep. ie. #!/bin/sh rep -R 'metag tag line' '' /dir/*
__________________
Skype variuscr - Email varius AT gmail |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Join Date: Jan 2003
Posts: 3,852
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Aug 2004
Location: IwantU.com
Posts: 570
|
Use this script
You owe me NOTHING! ![]() sub replace; $recursive = 0; sub Printmenu { print "Usage is: recureplace [option] 'find text' 'replace text' file1 file2 ... \n\n"; print " Replace the specified text in the specified files.\n\n"; print " options are:\n"; print " -e file_extension to replace word only in files matching the\n"; print " extension\n"; print " -R Recursive Perform recursively the replacement on all the\n"; print " files of all directories\n"; exit; } while ($ARGV[0] =~ /^-/) { if ($ARGV[0] eq "-R") { $recursive = 1;} elsif ($ARGV[0] eq "-e") { shift; $extension = $ARGV[0];} shift; } if (($ARGV[0] eq "") || ($ARGV[1] eq "")) { &Printmenu;} $find_txt = $ARGV[0]; shift; $replace_txt = $ARGV[0]; shift; &find('.'); [zeus@baileys (Aug 06 - 3:17am) - /home/zeus] ls -la /usr/local/bin/rep -rwxr-xr-x 1 root wheel 2386 Jul 1 2002 /usr/local/bin/rep [zeus@baileys (Aug 06 - 3:17am) - /home/zeus] more /usr/local/bin/rep #!/usr/bin/perl sub replace; $recursive = 0; sub Printmenu { print "Usage is: recureplace [option] 'find text' 'replace text' file1 file2 ... \n\n"; print " Replace the specified text in the specified files.\n\n"; print " options are:\n"; print " -e file_extension to replace word only in files matching the\n"; print " extension\n"; print " -R Recursive Perform recursively the replacement on all the\n"; print " files of all directories\n"; exit; } while ($ARGV[0] =~ /^-/) { if ($ARGV[0] eq "-R") { $recursive = 1;} elsif ($ARGV[0] eq "-e") { shift; $extension = $ARGV[0];} shift; } if (($ARGV[0] eq "") || ($ARGV[1] eq "")) { &Printmenu;} $find_txt = $ARGV[0]; shift; $replace_txt = $ARGV[0]; shift; &find('.'); sub find { local($dir,$nlink) = @_; local($dev,$ino,$mode,$subcount); ($dev,$ino,$mode,$nlink) = stat ('.') unless $nlink; opendir(DIR,'.')|| die "Can't open $dir"; local(@filenames)= readdir(DIR); closedir(DIR); if (!($recursive)) { @filenames = @ARGV; } $subcount = $nlink - 1; for (@filenames) { next if $_ eq '.'; next if $_ eq '..'; $name= $_; if (!(-d $name)){ if ($extension ne '') { next if (!(m/.*\.$extension$/i)) } replace($name); } next if $subcount hahahaha0; ($dev,$ino,$mode,$nlink) = lstat($_); next unless -d _; if ($recursive) { print "\nDirectory: $dir/$name\n"; chdir $_ || die "Can't cd to $name"; &find($name,$nlink); chdir '..'; --$subcount; } } } sub replace { local ($filename)= @_; if ((-r $filename) && (-w $filename) && (-s $filename)) { $size = (-s $filename); print "Replacing $find_txt by $replace_txt in $filename ($size)\n"; open(FILE,"<$filename"); read(FILE, $file_text, $size, 0); close(FILE); $file_text =~ s/$find_txt/$replace_txt/g; open(FILE,">$filename") || die "Could not create $filename\n"; print FILE $file_text; close(FILE); } else { print "I have no right to modify $filename"; } }
__________________
$100 PPS Promotion -------- Michael M ICQ: 551-376 http://affiliate.IwantU.com Our members get laid, our affiliates get paid |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Confirmed User
Join Date: Jan 2003
Posts: 3,852
|
Quote:
![]() Any chance of a brief description of what it does? And installation/configuration requirements? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Cyprus
Posts: 1,327
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
http://discuss.fogcreek.com/citydesk...68&ixReplies=1
I just asked them... there is your answer. So next time i think ist easier when you ask their support :-)
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | ||
Confirmed User
Join Date: Jan 2003
Posts: 3,852
|
Quote:
![]() But I DID ask Fog Creek support prior to posting on GFY and they replied: Quote:
|
||
![]() |
![]() ![]() ![]() ![]() ![]() |