Skip to content

Commit

Permalink
Merge pull request #258 from KomodoPlatform/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharang committed Apr 22, 2024
2 parents 1db36f7 + f043b72 commit fa6e2ab
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 11 deletions.
16 changes: 12 additions & 4 deletions authors.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"username": "smk762",
"commit_emails": [
"smk762@iinet.net.au",
"35845239+smk762@users.noreply.github.com"
"35845239+smk762@users.noreply.github.com",
"smk@komodoplatform.com"
],
"socials": {
"twitter": "",
Expand Down Expand Up @@ -438,7 +439,10 @@
},
"laruh": {
"username": "laruh",
"commit_emails": [],
"commit_emails": [
"oblomoff616@gmail.com",
"laruh@users.noreply.github.com"
],
"socials": {
"twitter": "",
"linkedin": ""
Expand All @@ -449,7 +453,9 @@
},
"kivqa": {
"username": "kivqa",
"commit_emails": [],
"commit_emails": [
"loskj200@gmail.com"
],
"socials": {
"twitter": "",
"linkedin": ""
Expand All @@ -460,7 +466,9 @@
},
"AndrewDelaney": {
"username": "AndrewDelaney",
"commit_emails": [],
"commit_emails": [
"30876243+AndrewDelaney@users.noreply.github.com"
],
"socials": {
"twitter": "",
"linkedin": ""
Expand Down
8 changes: 8 additions & 0 deletions utils/_fileData.json
Original file line number Diff line number Diff line change
Expand Up @@ -4721,6 +4721,10 @@
{
"name": "\"smk762\"",
"email": "smk762@iinet.net.au"
},
{
"name": "\"kivqa\"",
"email": "loskj200@gmail.com"
}
],
"dateCreated": "2024-03-08T07:31:21.000Z",
Expand Down Expand Up @@ -4931,6 +4935,10 @@
{
"name": "\"gcharang\"",
"email": "21151592+gcharang@users.noreply.github.com"
},
{
"name": "\"laruh\"",
"email": "oblomoff616@gmail.com"
}
],
"dateCreated": "2024-03-08T07:31:21.000Z",
Expand Down
19 changes: 18 additions & 1 deletion utils/_fileData_old_documentation_mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,10 @@
{
"name": "\"smk762\"",
"email": "smk762@iinet.net.au"
},
{
"name": "\"kivqa\"",
"email": "loskj200@gmail.com"
}
],
"lastContributor": {
Expand Down Expand Up @@ -2360,6 +2364,19 @@
"email": "21151592+gcharang@users.noreply.github.com"
}
},
"/komodo-defi-framework/api/v20-dev/non_fungible_tokens": {
"dateModified": "2023-07-10T00:43:36.000Z",
"contributors": [
{
"name": "\"laruh\"",
"email": "oblomoff616@gmail.com"
}
],
"lastContributor": {
"name": "\"laruh\"",
"email": "oblomoff616@gmail.com"
}
},
"/komodo-defi-framework/api/legacy/coins_needed_for_kick_start": {
"dateModified": "2023-07-10T00:43:36.000Z",
"contributors": [
Expand Down Expand Up @@ -8389,4 +8406,4 @@
"email": "mrgcharang@gmail.com"
}
}
}
}
23 changes: 17 additions & 6 deletions utils/js/get_file_author_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import fs from 'fs';
import https from 'https';
import path from 'path';
import { spawnSync } from 'child_process';
import { get } from 'http';
const authorsData = JSON.parse(fs.readFileSync("./authors.json", 'utf8'));
const oldFileData = JSON.parse(fs.readFileSync("./utils/_fileData_old_documentation_mod.json", 'utf8'));

const fileData = {};

(async function () {
const contributorsInfoUrl = "https://api.github.com/repos/komodoplatform/komodo-docs-mdx/contributors"
const allContributorsDataUrl = "https://api.github.com/repos/komodoplatform/komodo-docs-mdx/contributors"

const options = {
headers: {
Expand All @@ -18,13 +17,23 @@ const fileData = {};
};

try {
const { response } = await httpsGet(contributorsInfoUrl, options)
const { response } = await httpsGet(allContributorsDataUrl, options)
const contributorData = JSON.parse(response)
contributorData.forEach(contributor => {
for (const contributor of contributorData) {
if (!authorsData[contributor.login]) {
const { response } = await httpsGet(`https://api.github.com/repos/komodoplatform/komodo-docs-mdx/commits?author=${contributor.login}`, options)
const contributorCommits = JSON.parse(response)
console.log(contributorCommits)
const commit_emails = new Set();
contributorCommits.forEach(commit => {
if (commit.commit && commit.commit.author && commit.commit.author.email) {
commit_emails.add(commit.commit.author.email);
}
});
console.log(commit_emails)
authorsData[contributor.login] = {
username: contributor.login,
commit_emails: [],
commit_emails: Array.from(commit_emails),
socials: {
twitter: "",
linkedin: ""
Expand All @@ -33,7 +42,7 @@ const fileData = {};
}
authorsData[contributor.login].id = contributor.id
authorsData[contributor.login].avatar_url = contributor.avatar_url
});
}
} catch (error) {
console.error(error);
}
Expand All @@ -44,6 +53,8 @@ const fileData = {};
authorsData[username].image = imgName
}



fs.writeFileSync("authors.json", JSON.stringify(authorsData, null, 4))


Expand Down

0 comments on commit fa6e2ab

Please sign in to comment.