Shabat Closer

Tuesday, April 23, 2013

TECH: auto load many sitemaps to google webmaster

upload multiple sitemaps to google, by automation javascript script.

auto load many sitemaps to google webmaster

  1. Login to google webmaster
  2. go to Sitemap TAB.
  3. Press F12 on keyboard.
  4. go to Console TAB.
  5. click on Multi Line Mode
  6. paste the following 

/****************************************************
* Variables :                                       *
* the following variables will upload               *
* the sitemap files                                 *
*   from : xmlmap.php?index=0                       *
*   to   : xmlmap.php?index=10                      *
*                                                   *
*  Upload FILE: baseSiteMapName + (jump * index)    *
*****************************************************/
var jump = 1;                               //Jump index count(Only if you need it...).
var index = 0;                              //Start index position.
var end = 10;                               //End index position.
var baseSiteMapName = "xmlmap.php?index=";  //sitemap file.
var UploadDelay = 1000;                     //Delay between uploads.
/**************
* the code   *
**************/
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js';
head.appendChild(script);
function upload_smap() {
    document.getElementById("gwt-uid-58").click();
    document.getElementById("gwt-uid-77").click();
    $("input[type='text']").val(baseSiteMapName + (jump * index));
    document.getElementById("gwt-uid-67").click();
    console.log(index);
    index++;
    if (index > end)
        clearInterval(uploadInt);
}
var uploadInt = setInterval(upload_smap, UploadDelay);

  1. change the variables to your site configuration.
  2. Click "Run Script"

Enjoy!

No comments:

Post a Comment