Last active
August 29, 2015 14:22
-
-
Save ryanjadhav/3d0d9d7ce05609d37797 to your computer and use it in GitHub Desktop.
copy_braintree_codes.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment