Skip to content

Instantly share code, notes, and snippets.

@RandomEtc
Created July 27, 2010 06:12
Show Gist options
  • Save RandomEtc/491827 to your computer and use it in GitHub Desktop.
Save RandomEtc/491827 to your computer and use it in GitHub Desktop.
load csv files from anywhere using YQL
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
url: 'http://query.yahooapis.com/v1/public/yql',
data: {
q: "select * from csv where url='http://www.tom-carden.co.uk/p5/tube_map_travel_times/data/lines2.csv' and columns='station1,station2,line,time'",
format: 'json'
},
dataType: 'jsonp',
success: function(rsp) {
console.log(rsp);
// iterate over rsp.query.results.row (an array)
}
});
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment