nkgokul
2/23/2015 - 8:45 AM

Generate a link to SimplyTest.me from DrupalXray.com

Generate a link to SimplyTest.me from DrupalXray.com

var generateString = "http://simplytest.me/project/drupal/";
var drupalVersionString = jQuery(".xray-site div.xray-site-info:nth-child(3)").text();
var drupalVersion = drupalVersionString.split(": ").pop();
generateString += drupalVersion + "?";
jQuery(".xray-site-modules ul li a").each(
  function(){
      var url = jQuery(this).attr("href");
      var lastPart = url.split("/").pop();
      generateString += "add[]=" + lastPart + "&";
    }
  );
console.log(generateString);