Permalink
Browse files

tool, feat: upgrade awesome sync tool.

  • Loading branch information...
xicilion committed Nov 30, 2017
1 parent ac25be1 commit d59b73839fffde92615db223659094abf9968823
Showing with 6 additions and 2 deletions.
  1. +6 −2 tools/awesome.js
View
@@ -27,7 +27,9 @@ fs.mkdir(path.join(docsFolder, 'module'));
var token = 'xxxxxxxxxxxxxx';
var list = new Buffer(http.get("https://api.github.com/repos/fibjs/awesome/readme", {
"Authorization": "token " + token
headers: {
"Authorization": "token " + token
}
}).json().content, 'base64').toString();
var ls = [];
@@ -36,7 +38,9 @@ list = list.replace(/- \[(.+?)\]\((.+?)\)/g, (s, s1, s2) => {
console.log('getting', u);
coroutine.sleep(100);
var doc = new Buffer(http.get(u, {
"Authorization": "token " + token
headers: {
"Authorization": "token " + token
}
}).json().content, 'base64').toString();
fs.writeTextFile(path.join(docsFolder, 'module', s1 + '.md'), doc);

0 comments on commit d59b738

Please sign in to comment.