@@ -23,15 +22,12 @@ fetch (`https://api.github.com/users/${USER}`)
}
getProfile()
-//fetch for Technigo forked repos
+//Fetch for Technigo forked repos
const getRepos = () => {
fetch (REPOS_URL)
.then(response => response.json())
.then(data => {
- console.log(data)
const forkedRepos = data.filter(repo => repo.fork && repo.name.startsWith('project-'))
- //forkedRepos.forEach(repo => console.log(repo.name)) //logs all filtered repo
-
forkedRepos.forEach((repo) => {
projectsContainer.innerHTML += `
@@ -52,16 +48,14 @@ const getRepos = () => {
})
}
-//fetch pull request
+//Fetch pull request
const fetchPulls = (allRepositories) => {
allRepositories.forEach((repo) => {
const PULL_URL = `https://api.github.com/repos/Technigo/${repo.name}/pulls?per_page=100`
fetch(PULL_URL)
.then((response) => response.json())
.then((data) => {
- //console.log(`Mother repo for project ${repo.name}`, data)
const myPullRequest = data.find(pull => pull.user.login === repo.owner.login)
- //console.log(myPullRequest)
if (myPullRequest){
fetchCommits(myPullRequest.commits_url, repo.name)
} else {
@@ -71,7 +65,7 @@ const fetchPulls = (allRepositories) => {
})
}
-//fetch nr of commits
+//Fetch nr of commits
const fetchCommits = (myCommitsUrl, RepoName) => {
fetch(myCommitsUrl)
.then((response) => response.json())
@@ -80,7 +74,7 @@ const fetchCommits = (myCommitsUrl, RepoName) => {
})
}
-//Fetch last commit message
+//Fetch last commit messages
const commitComments = (forkedRepos) => {
forkedRepos.forEach((repo) => {
const COM_URL = `https://api.github.com/repos/dandeloid/${repo.name}/commits`
@@ -108,13 +102,7 @@ const commitComments = (forkedRepos) => {
})
}
-//${repo.pushed_at.slice(0, 10)} - ${repo.pushed_at.slice(11, 16)}
-// new Date(repo.pushed_at).toDateString()
-
- //https://api.github.com/repos/dandeloid/project-news-site/languages
- //https://api.github.com/repos/dandeloid/project-business-site/commits
-
-
+//Start fetching repository data
getRepos()
From c83b78731742da5e64b611d2d632000a9e04aa02 Mon Sep 17 00:00:00 2001
From: dandeloid <82587220+dandeloid@users.noreply.github.com>
Date: Sun, 3 Oct 2021 19:16:27 +0200
Subject: [PATCH 09/10] changed place branch/last push
---
code/script.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/script.js b/code/script.js
index 36331f39..afd9cc02 100644
--- a/code/script.js
+++ b/code/script.js
@@ -32,8 +32,8 @@ const getRepos = () => {
projectsContainer.innerHTML += `
${repo.name}
-
Last push: ${repo.pushed_at.slice(0, 10)} - ${repo.pushed_at.slice(11, 16)}
Branch: ${repo.default_branch}
+
Last push: ${repo.pushed_at.slice(0, 10)} - ${repo.pushed_at.slice(11, 16)}
Commits:
From 9c4061ad757eecbc5bb57fcfc813a5dd06d231e3 Mon Sep 17 00:00:00 2001
From: dandeloid <82587220+dandeloid@users.noreply.github.com>
Date: Wed, 13 Oct 2021 16:05:24 +0200
Subject: [PATCH 10/10] updated readme
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 181e7645..de84106d 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Project making a GitHub tracker that tracks my profile repositories data with th
## The problem
-Watched the Technigo session lectures and resources to get an idea how to approach the task at hand. Tried to make it look sort of similar to GitHub.
+Watched the online lectures and resources to get an idea how to approach the task at hand. Tried to make it look sort of similar to GitHub.
Used a lot of fetch of APIs and tried to figure out which data that was relevant to use and how to add it on the page in a good way.
If I had more time I would've wanted to grab more data and charts adding more content.