Skip to content

Instantly share code, notes, and snippets.

@nitinthewiz
Created October 27, 2016 20:01
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 nitinthewiz/4a2751f00969a938220ec8282f41d05c to your computer and use it in GitHub Desktop.
Save nitinthewiz/4a2751f00969a938220ec8282f41d05c to your computer and use it in GitHub Desktop.
Steps to get Asian Music chart
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. $$$$
@nitinthewiz
Copy link
Author

Of course, it would be better if we could just get a nice js API going for this instead...

@nitinthewiz
Copy link
Author

There's also http://www.developerdan.com/table-to-json/ which may be of some use.

@nitinthewiz
Copy link
Author

@nitinthewiz
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment