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..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://activity-graph.herokuapp.com/graph?username=${username}&bg_color=ffffff&color=708090&line=24292e&point=24292e` + 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(); }