Need script example for calculating domain age

Discussion in 'PHP' started by pubdomainshost.com, Sep 1, 2009.

  1. #1
    Hi,
    Does anyone have a simple script to check age of domain? I have checked whois script but the problem is gathering too much data where all I need for my program is the age of domain.

    Any inputs / guidance appreciated!
     
    pubdomainshost.com, Sep 1, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    if (preg_match('/Creation Date: ([0-9]+\-[a-z]+\-[0-9]+)/i', $whois_output, $match)) {
       $creation_date = strtotime(trim($match[1]));
       $difference = time() - $creation_date;
       echo 'Domain is ' . floor($difference/(60*60*24)) . ' days old';
    } else {
      echo 'no match found';
    }
    PHP:
     
    premiumscripts, Sep 1, 2009 IP
    pubdomainshost.com likes this.
  3. pneulameiro

    pneulameiro Peon

    Messages:
    440
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    the only way is by the whois script, but premmium provided a way to filter just the creation date.
     
    pneulameiro, Sep 1, 2009 IP
  4. pubdomainshost.com

    pubdomainshost.com Peon

    Messages:
    1,277
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks premiumscripts I would test this code and appreciate your quick response.
    Any way just to get date though - without processing the whole of whois response ?
     
    pubdomainshost.com, Sep 1, 2009 IP
  5. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #5
    No, not that I know of. You can check the enom api or other domain sellers, but they generally just allow you to query for the expiration date. Anyway, querying the whois seems like a fine solution, don't know why you'd want it any different.
     
    premiumscripts, Sep 1, 2009 IP
  6. dowload3s

    dowload3s Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    please give me api provide to get domain age.

    Thank
     
    dowload3s, Mar 7, 2012 IP