• 01-01-2022, 23:08:30
    #1
    Merhabalar arkadaşlar,
    yeni bir site kurdum ve bu siteyi aklıma gelen bütün tarayıcılara eklıyorum.
    Bing üzerinde urler hemen index alsın diye manuel gonderım yapacaktım ki api ile gönderim gördüm.
    Bu işlem nasıl yapılıyor bilginiz var mı ?

    Bing api bilgisi burada
  • 04-01-2022, 18:26:02
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Örnek json u vermiş hocam
    POST /webmaster/api.svc/json/SubmitUrlbatch?apikey=sampleapikeyEDECC1EA4AE341CC 8B6 HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: ssl.bing.com

    {
    "siteUrl":"http://yoursite.com",
    "urlList":[
    "http://yoursite.com/url1",
    "http://yoursite.com/url2",
    "http://yoursite.com/url3"
    ]
    }

    JSON response sample:

    HTTP/1.1 200 OK
    Content-Length: 10
    Content-Type: application/json; charset=utf-8

    {
    "d":null
    }

    Neyi sorduğunuzu anlamadım. Url list şeklinde bir array olarak atabiliyorsunuz.
  • 04-01-2022, 19:47:50
    #3
    dnzdmrl91 adlı üyeden alıntı: mesajı görüntüle
    Örnek json u vermiş hocam
    POST /webmaster/api.svc/json/SubmitUrlbatch?apikey=sampleapikeyEDECC1EA4AE341CC 8B6 HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: ssl.bing.com

    {
    "siteUrl":"http://yoursite.com",
    "urlList":[
    "http://yoursite.com/url1",
    "http://yoursite.com/url2",
    "http://yoursite.com/url3"
    ]
    }

    JSON response sample:

    HTTP/1.1 200 OK
    Content-Length: 10
    Content-Type: application/json; charset=utf-8

    {
    "d":null
    }

    Neyi sorduğunuzu anlamadım. Url list şeklinde bir array olarak atabiliyorsunuz.
    Bunu nereye yazacağımı ve nasıl çalıştıracağımı bulamadım hocam.
    Kod bilgim olmadığı için zorlandım.
  • 05-01-2022, 18:22:04
    #4
    Canmemis adlı üyeden alıntı: mesajı görüntüle
    Bunu nereye yazacağımı ve nasıl çalıştıracağımı bulamadım hocam.
    Kod bilgim olmadığı için zorlandım.
    PHP ile yapacaksanız curl ile post ettirmeniz lazım.

    <?php
    $url = "https://ssl.bing.com/webmaster/api.svc/json/SubmitUrlbatch?apikey=<API KEY>";
    $post_json = array(
        "siteUrl" => "http://yoursite.com",
        array(
            "urlList" => "http://yoursite.com/url1",
            "http://yoursite.com/url2",
            "http://yoursite.com/url3"
        )
    );
    $postdata = json_encode($post_json);
    $c = curl_init();
    curl_setopt($c, CURLOPT_URL, $url);
    curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($c, CURLOPT_POST, 1);
    curl_setopt($c, CURLOPT_POSTFIELDS, $postdata);
    curl_setopt($c, CURLOPT_HTTPHEADER, array(
        "Content-Type: application/json; charset=utf-8",
        "Host: ssl.bing.com",
    ));
    curl_setopt($c, CURLOPT_HEADER, 0);
    curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
    
    $d = curl_exec($c);
    curl_close($c);
    print_r($d);
    ?>
  • 06-01-2022, 07:26:06
    #5
    Bezos adlı üyeden alıntı: mesajı görüntüle
    PHP ile yapacaksanız curl ile post ettirmeniz lazım.

    <?php
    $url = "https://ssl.bing.com/webmaster/api.svc/json/SubmitUrlbatch?apikey=<API KEY>";
    $post_json = array(
        "siteUrl" => "http://yoursite.com",
        array(
            "urlList" => "http://yoursite.com/url1",
            "http://yoursite.com/url2",
            "http://yoursite.com/url3"
        )
    );
    $postdata = json_encode($post_json);
    $c = curl_init();
    curl_setopt($c, CURLOPT_URL, $url);
    curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($c, CURLOPT_POST, 1);
    curl_setopt($c, CURLOPT_POSTFIELDS, $postdata);
    curl_setopt($c, CURLOPT_HTTPHEADER, array(
        "Content-Type: application/json; charset=utf-8",
        "Host: ssl.bing.com",
    ));
    curl_setopt($c, CURLOPT_HEADER, 0);
    curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
    
    $d = curl_exec($c);
    curl_close($c);
    print_r($d);
    ?>
    Yani şimdi bu kod bloğunun içine kendi linklerimi ekleyip, hostingde ana dizine atıp PHP dosyasını calistiracagim doğru mu anladim hocam.
  • 06-01-2022, 09:12:11
    #6
    Canmemis adlı üyeden alıntı: mesajı görüntüle
    Yani şimdi bu kod bloğunun içine kendi linklerimi ekleyip, hostingde ana dizine atıp PHP dosyasını calistiracagim doğru mu anladim hocam.
    Evet