aboutsummaryrefslogtreecommitdiffstats
path: root/gdocs.js
diff options
context:
space:
mode:
authorIgor Minar2011-05-09 23:47:44 -0700
committerIgor Minar2011-06-06 22:28:39 -0700
commit91f9efed49a64f626251feac952fac470f6fe13c (patch)
treefd2e5bfa2d72b63ffebe3d5366d22df748e7a77b /gdocs.js
parent2094bc8f61486a978d8fe6daf2d03e18c55f35d3 (diff)
downloadangular.js-91f9efed49a64f626251feac952fac470f6fe13c.tar.bz2
gdocs.js should store files under docs/content/[collection]/
Diffstat (limited to 'gdocs.js')
-rwxr-xr-xgdocs.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdocs.js b/gdocs.js
index 2a991b26..af5ed51d 100755
--- a/gdocs.js
+++ b/gdocs.js
@@ -38,9 +38,8 @@ function help(){
};
-function fetch(name, url){
- //https://docs.google.com/feeds/default/private/full/folder%3Afolder_id/contents
- console.log('fetching a list of docs in collection ' + name + '...');
+function fetch(collection, url){
+ console.log('fetching a list of docs in collection ' + collection + '...');
request('GET', url, {
headers: {
'Gdata-Version': '3.0',
@@ -54,14 +53,14 @@ function fetch(name, url){
var title = entry.match(/<title>(.*?)<\/title>/)[1];
if (title.match(/\.ngdoc$/)) {
var exportUrl = entry.match(/<content type='text\/html' src='(.*?)'\/>/)[1];
- download(title, exportUrl);
+ download(collection, title, exportUrl);
}
});
}
);
}
-function download(name, url) {
+function download(collection, name, url) {
console.log('Downloading:', name, '...');
request('GET', url + '&exportFormat=txt',
{
@@ -87,7 +86,7 @@ function download(name, url) {
data = data + '\n';
- fs.writeFileSync('docs/' + name, reflow(data, 100));
+ fs.writeFileSync('docs/content/' + collection + '/' + name, reflow(data, 100));
}
);
}