I would like to do as follows. What would be the best way? A general answer will also be fine.
I would like to intercept an HTTP request at the client end to alter some
You can do this with Privoxy via their filter files. Their fun filter is a good example of exactly the sort of substitutions you want to do.
To replace "Two LA Dogs Marry" with "Ridiculous Title Blocked" on cnn.com your action file would look something like this:
{ +filter{ridiculous-title-censor} } .cnn.com
and your filter file would look like
# FILTER: ridiculous-title-censor Remove ridiculous titles # This keeps CNN from getting too ridiculous # s/Two LA Dogs Marry/Ridiculous Title Blocked/ig