Skip to content

Instantly share code, notes, and snippets.

@davestewart
Last active August 29, 2015 13:57
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 davestewart/9722022 to your computer and use it in GitHub Desktop.
Save davestewart/9722022 to your computer and use it in GitHub Desktop.
Unlock all heart domains from their "list domains" page.
var str = '';
$('a[href^="/domains/"]').each(function(i, e){
var $e = $(e);
var url = $(e).attr('href').replace('index.cgi', 'action.cgi?action=lock_unset');
$(e).attr('href', url);
$.get(url, function(data){
data = data.replace(/^[\s\S]+?<body.+?>|<\/body>[\s\S]+$/g, '');
var $dom = $('<div>').html(data);
str += $dom.find('#yesbox p').text() + '\n';
console.clear();
console.log(str);
});
console.log(url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment