Trying to de-"g" my pages

Discussion in 'PHP' started by SFOD_D223, Jun 12, 2006.

  1. #1
    Help, i'm new to this php stuff and trying to remove all of the "G" adsense from entire site. I was able to get index.php and .html de-geegled but can't get rid of ads on subsequent content pages.

    Any magic bullet around?
     
    SFOD_D223, Jun 12, 2006 IP
  2. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you are using indexx.php it sounds like you are using some kind of CMS. There should be a template for the content pages. Go into the tmeplate directpory and use grep to so if you can find files with the AdSense code.

    Try:

    grep -il "google_ad_client" *.*

    That will output a list of offending files. You can then edit by hand.

    If AdSense is hard coded into 10,000 pages, then you will want to write some kind of script to handle the job. Perl would work nicely for the task.
     
    clancey, Jun 12, 2006 IP
  3. SFOD_D223

    SFOD_D223 Peon

    Messages:
    4,512
    Likes Received:
    174
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Without trying to sound too much like a newb, where do I put this "grep" command?
     
    SFOD_D223, Jun 13, 2006 IP
  4. goldensea80

    goldensea80 Well-Known Member

    Messages:
    422
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    128
    #4
    What is your php stuff and from where did you get it?
     
    goldensea80, Jun 14, 2006 IP
  5. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sorry to have not dropped back in a couple of days. You need to go to a command prompt in linix or unix and cd (change directory) into the directory which contains your templates and type grep -il "google_ad_client" *.*

    grep is command line utility available on Linux, Unix and Macs. There are also versions available for windows.

    If you are on a windows computer, just use the Find program and look for all pages in the template directory with contains the phrase "google_ad_client"
     
    clancey, Jun 15, 2006 IP
  6. SFOD_D223

    SFOD_D223 Peon

    Messages:
    4,512
    Likes Received:
    174
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks Clancey, i'll give it a whirl when I get to a PC that allows heavily scripted pages to show.i.e. I can't get to my cpanel...
     
    SFOD_D223, Jun 16, 2006 IP
  7. balamm

    balamm Peon

    Messages:
    64
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I might even pay for something like that if it worked :)
    Doesn't seem to be any readily available code to do this at all.

    I've played with grep a bit but I don't want to take a chance on messing up 14 gig and 30 domains just to get rid of adsense.

    All I really need to remove is the script calls.
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    Code (markup):
    The rest doesn't matter if it stays there.
     
    balamm, Jun 23, 2006 IP
  8. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You can find a command line program in perl which does the trick. I use it.

    http://193.125.152.107/pub/unix/search/sar

    I do not know how long there are going to be copies of this tool in archives. The author got fairly involved with Linux and open source projects between 1998 and 2000, but seems to have dropped out of sight since that time.

    To use it, place the script in an easy to remember location and run it like thus, with everything on a single line:

    perl /home/ME/sar.pl "src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"" "" *.html

    By getting rid of the src=" segment it will neuter the script and you should be de-G'ed.

    To test, make a copy of a single file. Run it against that file and open it in a browser.
     
    clancey, Jun 24, 2006 IP
  9. balamm

    balamm Peon

    Messages:
    64
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks, I'll give that a try :)
     
    balamm, Jun 25, 2006 IP