Auto-Scan for <H1> or any other header tags

Discussion in 'Products & Tools' started by TrafficLicious, Dec 5, 2007.

  1. #1
    Hi all,

    Does anyone know of any desktop application or online website that allows us to put in a URL/webpage and scan for presence of any <H1> or any other header tags in their HTML?

    Thanks much!
     
    TrafficLicious, Dec 5, 2007 IP
  2. chandubhai

    chandubhai Banned

    Messages:
    556
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can write a code for you quickly.
     
    chandubhai, Dec 6, 2007 IP
  3. TrafficLicious

    TrafficLicious Active Member

    Messages:
    371
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    80
    #3
    hi chandubhai,

    Please provide details. Thanks.
     
    TrafficLicious, Dec 6, 2007 IP
  4. Estevan

    Estevan Peon

    Messages:
    120
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    0
    #4
    here is a simple example maybe help you

    <?php
    if(isset($_POST['url']))
    {
    $ch = curl_init();
    
    curl_setopt($ch, CURLOPT_URL,$_POST['url']);
    curl_setopt($ch, CURLOPT_TIMEOUT, 20);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    
    $result=curl_exec ($ch);
    
    curl_close ($ch);
    
    preg_match_all("#<".$_POST['tag']."(.*?)>(.*?)</".$_POST['tag'].">#s",$result,$titles);
    
    foreach($titles[2] as $value)
    {
    
    echo strip_tags($value)."<br />";
    
    }
    }
    ?>
    <form action="" method="post" >
    
    Tag <select name="tag">
    <option value="h1">h1</option>
    <option value="h2">h2</option>
    <option value="h3">h3</option>
    <option value="h4">h4</option>
    <option value="h5">h5</option>
    </select>
    
    URL <input type="text" name="url" />
    </form>
    PHP:
    best
     
    Estevan, Dec 6, 2007 IP
  5. TrafficLicious

    TrafficLicious Active Member

    Messages:
    371
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    80
    #5
    Hi Estevan,

    Brilliant! Thanks for your contribution. I'll integrate this into my site tools as and when I'm ready.

    Cheers!
     
    TrafficLicious, Dec 6, 2007 IP