Created
October 27, 2016 20:01
-
-
Save nitinthewiz/4a2751f00969a938220ec8282f41d05c to your computer and use it in GitHub Desktop.
Steps to get Asian Music chart
This file contains 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
Steps to get Asian Music chart | |
1. Open http://www.bbc.co.uk/asiannetwork/chart/print | |
2. Fire up jQuerify using https://chrome.google.com/webstore/detail/jquerify/gbmifchmngifmadobkcpijhhldeeelkc | |
3. Run the below script in the console to get the tbl variable | |
var tbl = $('table tr:has(td)').map(function(i, v) { | |
var $td = $('td', this); | |
return { | |
id: ++i, | |
artist: $td.eq(4).text(), | |
title: $td.eq(5).text() | |
} | |
}).get(); | |
console.log(tbl) | |
4. Right click on the printed object and click "Store as Global variable" | |
5. It'll return a temp1 object | |
6. Use the following command in the console to copy the JSON to your clipboard - | |
copy(temp1) | |
7. $$$$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/12290927/how-to-convert-html-table-to-javascript-object-with-jquery for the original script