all da files

This commit is contained in:
jllord
2013-05-27 13:45:59 -07:00
commit 59d3d30afa
6704 changed files with 1954956 additions and 0 deletions

39
node_modules/feed-tables/examples/example.html generated vendored Normal file
View File

@@ -0,0 +1,39 @@
<html>
<head>
<script src="../lib/feed-tables.js"></script>
<title>Feed Tables Example</title>
</head>
<body>
<script>
var URL = "https://spreadsheets.google.com/feeds/list/0AoooUkEfVrhldEpRekRVakVYWmJ2U2Z4SFBVZ0M1Nnc/od6/public/basic?alt=json&callback=dataReady";
function loadData() {
var scp = document.createElement('script');
scp.setAttribute("type","text/javascript");
scp.setAttribute("src", URL);
document.getElementsByTagName("head")[0].appendChild(scp);
}
function dataReady(data) {
var table = new ListFeed(data, ["name", "street", "city"]);
var div = document.getElementById("table"), s = "";
for (var r = 0; r < table.length; r++) {
var row = table.getRow(r);
s += "<p>" + row.name + ", " + row.street + ", " + row.city + "</p>";
}
div.innerHTML = s;
}
window.onload = function() { loadData(); };
</script>
<h1>Data from the spreadsheet</h1>
<div id="table"></div>
</body>
</html>

54
node_modules/feed-tables/examples/nodejs-example.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
var http = require('http');
var url = require('url');
var receive = function(dataUrl, dataReady) {
var urlp = url.parse(dataUrl);
var service = http.createClient(urlp.port ? urlp.port : 80, urlp.hostname);
var req = service.request('GET', urlp.pathname + urlp.search,
{'host': urlp.hostname});
var data = null, status = null, finished = false;
req.on('response', function (res) {
var body = "";
status = res.statusCode;
res.on('data', function (chunk) {
body += chunk;
});
res.on('end', function () {
data = JSON.parse(body);
if (!finished) {
finished = true;
dataReady(data);
}
});
});
req.end();
setTimeout(function() {
if (!finished) {
finished = true;
dataReady(null);
}
}, 2000);
};
console.log(process.cwd());
var ft = require(process.cwd() + '/lib/feed-tables.js');
receive("https://spreadsheets.google.com/feeds/cells/0AoooUkEfVrhldEpRekRVakVYWmJ2U2Z4SFBVZ0M1Nnc/od6/public/basic?alt=json",
function(data) {
if (data) {
var table = new ft.CellsFeed(data);
for (var r = 0; r < table.length; r++) {
var row = table.getRow(r);
console.log("name: " + row.name + ", street: " + row.street, " city: " + row.city + "\n");
}
} else
console.log("Timeout while fetching the Google Spreadsheet data.");
});