Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Export DNS records from bluehost.com with jQuery
- * Original Script Here: https://coolaj86.com/articles/export-dns-records-from-bluehost-com-with-jquery/
- * Changes: td fields are not converted to lower case
- * JSON key names have space replaced with _
- *
- * You sign in to BlueHost and go to your domain management page
- * Then open the Chrome JavaScript Console
- * Then paste the entirely of the script above and hit enter.
- * Viola, your DNS records as JSON!
- */
- var things = [];
- $('.rec_body').each(function (i, table) {
- var headers = [];
- $(table).find('.brand-table.rec_table.gridtable tr').each(function (j, tr) {
- if (0 === j) {
- $(tr).find('th').each(function (k, th) {
- headers[k] = ($(th).text()||'').toLowerCase().replace(' ', '_');
- });
- return;
- }
- var thing = {};
- $(tr).find('td').each(function (k, td) {
- thing[headers[k]] = ($(td).text()||'');
- });
- things.push(thing);
- });
- });
- console.log(JSON.stringify(things, null, ' '));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement