Skip to content

Instantly share code, notes, and snippets.

@KevinTCoughlin
Created March 8, 2014 17:04
Show Gist options
  • Save KevinTCoughlin/9435058 to your computer and use it in GitHub Desktop.
Save KevinTCoughlin/9435058 to your computer and use it in GitHub Desktop.
Graphing my weight
<!doctype html>
<html ng-app="app">
<head>
<title>Tracking My Weight</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.1/angular.min.js"></script>
<script type="text/javascript">
angular.module('app', []).
controller('WeightCtrl', function($http) {
var key = '0AjNYHy2ejpSKdDVxWDZMMTVpeXF6MGE3MkVsOWhwc2c';
var output = 'json';
var spreadsheetURL = 'http://cors.io/spreadsheets.google.com/feeds/cells/' + key + '/od6/public/values?alt=' + output;
var data = [];
$http.get(spreadsheetURL).success(function(d) {
var entries = d.feed.entry;
console.log(entries[5].content);
for (var i = 5; i < entries.length; i + 3) {
//console.log(entries[i])
}
});
});
</script>
</head>
<body data-ng-controller="WeightCtrl">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment