LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-11-2007, 04:35 AM   #1
Linuxer12345
LQ Newbie
 
Registered: Jul 2004
Posts: 24

Rep: Reputation: 15
Privoxy Text Replace


Is it possible to define a custom text replace in Privoxy? Say for example that I want to replace all occurrences or "Windows" to "Linux" in the source code of all web pages.
 
Old 03-13-2007, 05:21 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Yes, its possible. Unfortunately I am not near my computers that use Privoxy at the moment, so I might get some terminology wrong here. You can use perl style regular expressions (with a few Privoxy extensions) to do the substitution. It involves creating a new filter by editing a file (filter.default ?) and then selecting this filter (via the web interface or via editing the appropriate file(s)) to select which web pages to apply this to.

Make sure you save a backup of any file before you manually edit it. If you screw up the substitution command (as I have done -- magnificently!), you can seriously hose any page that filter gets applied to.

(When you find the correct file to put your new filter in, you will find many existing examples to help guide you. If you are doing anything at all advanced, you might want to get a referrence on perl regular expressions if you are not already familiar with them.)

Last edited by blackhole54; 03-13-2007 at 05:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
another question about search and replace text graziano1968 Linux - General 3 08-02-2006 09:35 AM
how to replace text from to ? graziano1968 Linux - General 2 08-02-2006 06:14 AM
Using sed to replace a lot of text Wynd Programming 9 10-07-2005 03:47 AM
Replace text of unknown content with other text in file brian0918 Programming 15 07-14-2005 09:22 PM
Replace text of unknown content with other text in file brian0918 Linux - Software 1 07-14-2005 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration