Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 7, 2025. It is now read-only.

Commit 992df0c

Browse files
committed
fetching all repos
1 parent 40fd960 commit 992df0c

File tree

3 files changed

+19
-38
lines changed

3 files changed

+19
-38
lines changed

‎package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{
2+
"scripts": {
3+
"repos": "node scripts/repos.js",
4+
"change": "node scripts/change.js",
5+
"add": "node scripts/git-add.js",
6+
"clone": "node scripts/git-clone.js",
7+
"commit": "node scripts/git-commit.js",
8+
"pull": "node scripts/git-pull.js",
9+
"push": "node scripts/git-push.js"
10+
},
211
"dependencies": {
312
"axios": "^0.20.0"
413
},

‎repos.json

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
11
[
2-
"java",
3-
"c",
4-
"r",
5-
"cpp",
6-
"go",
7-
"javascript",
8-
"shell",
9-
"php",
10-
"python",
11-
"ruby",
12-
"swift",
13-
"scala",
14-
"csharp",
15-
"lua",
16-
"assembly",
17-
"brainfuck",
18-
"perl",
19-
"haskell",
20-
"erlang",
21-
"objective-j",
22-
"fortran",
23-
"lisp",
24-
"lol",
25-
"maxima",
26-
"matlab",
27-
"clojure",
28-
"apple-script",
29-
"kotlin",
30-
"rust",
31-
"racket",
32-
"typescript",
33-
"julia"
2+
"fsharp",
3+
"jupyter",
4+
"coffeescript"
345
]

‎scripts/repos.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,28 @@
66
'use strict';
77
const fs = require('fs');
88
const axios = require('axios');
9+
const chalk = require('chalk');
910

1011
const getReposList = async () => {
1112
const endpoint = 'https://api.github.com/orgs/allalgorithms/repos';
1213

1314
return await axios
14-
.get(endpoint)
15+
.get(endpoint,{params: {per_page: 100}})
1516
.then((res) => res.data.map((repo) => repo.name))
1617
.catch((_) => {});
1718
};
1819

1920
(async () => {
2021
const repos = await getReposList();
21-
// TODO: check for `libraries, .github`
22-
const data = JSON.stringify(repos.filter((repo) => repo!=='algorithms'));
22+
constignore=['algorithms','.github'];
23+
const data = repos.filter((repo) => !ignore.includes(repo));
2324

24-
fs.writeFile('repos.json', data, 'utf8', (err) => {
25+
fs.writeFile('repos.json', JSON.stringify(data,null,4), 'utf8', (err) => {
2526
if (err) {
26-
console.log(err);
27+
console.log(chalk.red(`Error: ${err}`));
2728
return;
2829
}
2930

30-
console.log('Done!');
31+
console.log(chalk.green('Done!'));
3132
});
3233
})();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /