Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@nitinthewiz nitinthewiz commented Oct 27, 2016

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

@nitinthewiz

This comment has been minimized.

@nitinthewiz

This comment has been minimized.

Copy link
Owner Author

@nitinthewiz nitinthewiz commented Oct 27, 2016

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

@nitinthewiz

This comment has been minimized.

Copy link
Owner Author

@nitinthewiz nitinthewiz commented Oct 27, 2016

@nitinthewiz

This comment has been minimized.

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