Script to check if site is banned by adsense

Discussion in 'PHP' started by Joseph S, Aug 30, 2008.

  1. #1
    Heya folks!


    I have adsense on parked pages, I want to make a script that will check if the site is banned by adsense and if it is not, it will display adsense. Do you know how can I do that? or where to start?
     
    Joseph S, Aug 30, 2008 IP
  2. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use curl to grab the javascript file for adsense, with your parked domain as the referrer.
    If it returns the javascript, you can assume it is not banned.
     
    matthewrobertbell, Aug 31, 2008 IP
  3. Joseph S

    Joseph S Well-Known Member

    Messages:
    1,373
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    155
    #3
    How can I set my domain as referrer? I suppose adsense has some coding to check this..
     
    Joseph S, Aug 31, 2008 IP
  4. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #4
    If what matthewrobertbell said is correct, you can use curl or a direct socket. However, I also have a hunch Google run more client-side checks using things like document.location, as not all browsers will send a Referer.

    Jay
     
    jayshah, Aug 31, 2008 IP
  5. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ideally, you'd sniff all traffic between a browser (that has just had all of its caches cleared) and adsense, when you load an adsense site.

    livehttpheaders for firefox will be useful
     
    matthewrobertbell, Aug 31, 2008 IP
  6. Joseph S

    Joseph S Well-Known Member

    Messages:
    1,373
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    155
    #6
    Anyone can come up with some code for this?
     
    Joseph S, Aug 31, 2008 IP
  7. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Just find a curl tutorial, then make sure you are setting the referrer (and probably user agent) right for connecting to adsense.
     
    matthewrobertbell, Aug 31, 2008 IP
  8. lovelycesar

    lovelycesar Peon

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Can you try to email to Google Inc. to ask them if they have any API or opensource?
     
    lovelycesar, Sep 1, 2008 IP