From adb6e711fd3eab33e0cc4d4e375c5ffcabd30214 Mon Sep 17 00:00:00 2001 From: chinmayshewale Date: Tue, 21 Feb 2023 23:52:40 +0530 Subject: [PATCH 1/2] Fixed Contribution Graph image URL --- github/handlers/ExecuteBlockActionHandler.ts | 3 ++- github/helpers/githubActivityGraphURL.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/github/handlers/ExecuteBlockActionHandler.ts b/github/handlers/ExecuteBlockActionHandler.ts index 066a4b4..6785f62 100644 --- a/github/handlers/ExecuteBlockActionHandler.ts +++ b/github/handlers/ExecuteBlockActionHandler.ts @@ -48,6 +48,7 @@ import { IssueDisplayModal } from "../modals/IssueDisplayModal"; import { IGitHubIssue } from "../definitions/githubIssue"; import { BodyMarkdownRenderer } from "../processors/bodyMarkdowmRenderer"; import { CreateIssueStatsBar } from "../lib/CreateIssueStatsBar"; +import { githubActivityGraphUrl } from "../helpers/githubActivityGraphURL"; export class ExecuteBlockActionHandler { @@ -331,7 +332,7 @@ export class ExecuteBlockActionHandler { }) if (profileShareParams.includes('contributionGraph')){ - block.addImageBlock({imageUrl : `https://activity-graph.herokuapp.com/graph?username=${userProfile.username}&bg_color=ffffff&color=708090&line=24292e&point=24292e`, altText: "Github Contribution Graph"}) + block.addImageBlock({imageUrl : githubActivityGraphUrl(userProfile.username), altText: "Github Contribution Graph"}) } diff --git a/github/helpers/githubActivityGraphURL.ts b/github/helpers/githubActivityGraphURL.ts index fe17d07..8e0720b 100644 --- a/github/helpers/githubActivityGraphURL.ts +++ b/github/helpers/githubActivityGraphURL.ts @@ -1,4 +1,4 @@ export function githubActivityGraphUrl(username : string): string { - return `https://activity-graph.herokuapp.com/graph?username=${username}&bg_color=ffffff&color=708090&line=24292e&point=24292e` + return `https://github-readme-activity-graph.cyclic.app/graph?username=${username}&bg_color=ffffff&color=708090&line=24292e&point=24292e&area=true&hide_border=true` } From 4d1161c333dc44fcd0973c02bb5f3f5466c31395 Mon Sep 17 00:00:00 2001 From: chinmayshewale Date: Sat, 1 Apr 2023 16:52:31 +0530 Subject: [PATCH 2/2] Comment and format --- github/helpers/githubActivityGraphURL.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/github/helpers/githubActivityGraphURL.ts b/github/helpers/githubActivityGraphURL.ts index 8e0720b..d1edb08 100644 --- a/github/helpers/githubActivityGraphURL.ts +++ b/github/helpers/githubActivityGraphURL.ts @@ -1,4 +1,19 @@ +export function githubActivityGraphUrl(username: string): string { + /* + We are using this project as a dependent project to generate our contribution graph image + for our GitHub profile! https://github-readme-activity-graph.cyclic.app/graph + The project can be found at :- https://github.com/Ashutosh00710/github-readme-activity-graph + */ + const baseUrl = "https://github-readme-activity-graph.cyclic.app/graph"; + let url = new URL(baseUrl); -export function githubActivityGraphUrl(username : string): string { - return `https://github-readme-activity-graph.cyclic.app/graph?username=${username}&bg_color=ffffff&color=708090&line=24292e&point=24292e&area=true&hide_border=true` + url.searchParams.append("user_name", username); + url.searchParams.append("bg_color", "ffffff"); + url.searchParams.append("color", "708090"); + url.searchParams.append("line", "24292e"); + url.searchParams.append("area", "true"); + url.searchParams.append("hide_border", "true"); + url.searchParams.append("&point", "24292e"); + + return url.toString(); }