• Códigos 03.06.2009

    Interesante código que hace uso de PHP y cURL para obtener el PageRank de cierto sitio web. Recuerda tener instalada y activada la librería libcurl.

    function cURL($url, $header, $cookie, $p)
    {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, $header);
    curl_setopt($ch, CURLOPT_NOBODY, $header);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_COOKIE, $cookie);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    if ($p) {
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $p);
    }
    ;
    $result = curl_exec($ch);
    curl_close($ch);
    if ($result) {
    return $result;
    } else {
    return curl_error($ch);
    }
    ;
    }
    ;
    if(isset($_GET['url']))
    {
    $rank=cURL(“http://dlls.info/results.php?url=”.$_GET['url'],0,0,null);
    echo $rank;
    echo ”
    <form method=get target=rank.php>
    URL:<input type=text name=url><input type=submit value=Submit>
    “;
    }
    else
    {
    ?>
    <form method=get target=rank.php>
    URL:<input type=text name=url>
    <input type=submit value=Submit>
    <?
    }
    ?>

    Related Posts with Thumbnails
    Comparte este artículo:
    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • Mixx
    • Google Bookmarks
    • BarraPunto
    • Meneame
    • Bitacoras.com
    • Technorati
    • Blogosphere News
    • Live
    • Yahoo! Bookmarks

    Miércoles, 3 de Junio de 2009

  • Leave a Comment

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Traductor

Nos han Visitado

  • 255093 Visitantes

Visitantes

    free counters

Comunidad


Publicidad


**************************************** PAGE RANK **********************************************-->