Skip to content

Instantly share code, notes, and snippets.

@nkgokul
Created February 23, 2015 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkgokul/465e8b96182aac186be6 to your computer and use it in GitHub Desktop.
Save nkgokul/465e8b96182aac186be6 to your computer and use it in GitHub Desktop.
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment