// Copies braintree webpage table into a more easily to consume json object. // Steps: // 1: go to https://developers.braintreepayments.com/ios+ruby/reference/general/countries // 2: include jquery on the page // 3: execute js below // grabs all country codes and puts it into a json object like so: {name: 'United States', code: 'US' } var json = []; $('table').find('tr').each(function(i, el) { json.push({'name': $(el).find('td:nth(0)').html(), 'code': $(el).find('td:nth(1)').html()} ) }); copy(json);