Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
added event history and commit history routes to api
Browse files Browse the repository at this point in the history
  • Loading branch information
sametcn99 committed Mar 16, 2024
1 parent 0d7e769 commit f360ae9
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/api/github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ Handles various GitHub API requests based on the specified `option` parameter.
### 8. Get Followings

- Example URL: `/api/github?option=followings&username=exampleUser&page=1`

### 8. Get Commit History

- Example URL: `/api/github?option=commit-history&username=exampleUser&reponame=exampleRepo`

### 8. Event Activity

- Example URL: `/api/github?option=event-activity&username=exampleUser`
31 changes: 31 additions & 0 deletions app/api/github/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export async function GET(request: NextRequest) {
const gistCount = searchParams.get("gistCount");
const chunk = searchParams.get("chunk");
const page = Number(searchParams.get("page"));
const reponame = searchParams.get("reponame");

const { userId } = auth();

Expand Down Expand Up @@ -104,6 +105,36 @@ export async function GET(request: NextRequest) {
});
}
break;
case "event-activity":
if (username) {
// Fetch user profile data
const profileResponse =
await octokit.rest.activity.listPublicEventsForUser({
username: username,
per_page: 100,
});
profile = profileResponse.data;
// Return JSON response with profile, repos, and gists data
return NextResponse.json({
profile: profile,
});
}
break;
case "commit-history":
if (username && reponame) {
// Fetch user profile data
const profileResponse = await octokit.rest.repos.listCommits({
owner: username,
repo: reponame,
per_page: 100,
});
profile = profileResponse.data;
// Return JSON response with profile, repos, and gists data
return NextResponse.json({
profile: profile,
});
}
break;

// Handle other GitHub API options
case "trending-developers":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "GitHub User Statistics: Unveiling the Numbers Behind the Code"
date: "2024-03-17"
description: "Dive into the fascinating world of GitHub statistics and discover the numerical insights that tell the story of developers' contributions, popular languages, and much more. This blog post explores the power of data in understanding the GitHub ecosystem."
author: "admin"
keywords: "GitHub Profile Viewer, Github User Statistics, Github Profile Statistics"
---

# GitHub User Statistics: Unveiling the Numbers Behind the Code

Dive into the fascinating world of GitHub statistics and discover the numerical insights that tell the story of developers' contributions, popular languages, and much more. This blog post explores the power of data in understanding the GitHub ecosystem.

## Commit to Insight: The Power of Commit History

Commits are the heartbeat of GitHub repositories. They represent the incremental changes and improvements that developers make to their projects. By analyzing commit history, we can gauge a project's activity level, identify periods of intense development, and even spot patterns that might indicate a forthcoming release.

## Star Gazers: Understanding Repository Popularity

Stars on GitHub serve as bookmarks for interesting projects and also as endorsements. A repository with a high number of stars is not only more likely to be discovered by other users but also signals a level of quality or utility that resonates with the community. Tracking star history can reveal trends in technology and what tools or frameworks are currently in demand.

## Forks in the Road: Collaboration and Contribution

Forks are a clear indicator of a project's collaborative nature. When a user forks a repository, they create a personal copy they can modify without affecting the original codebase. A high number of forks often means that a project is not only popular but also invites contributions from the community, leading to diverse development paths and innovation.

## Language Landscape: The Syntax of Success

GitHub's vast array of projects is written in countless programming languages. By analyzing the languages used across repositories, we can identify which languages are trending, which are most commonly used in industry projects, and which might be declining in popularity. This information is invaluable for developers considering which language to learn next.

## Conclusion: The Story in the Statistics

GitHub user statistics offer more than just numbers; they tell the story of collaboration, innovation, and the evolution of technology. By understanding these statistics, developers can make informed decisions about which projects to contribute to, which technologies to invest time in learning, and how to position their projects for success in the open-source community.

Embrace the data, and let the statistics guide your GitHub journey. Whether you're a seasoned developer or just starting, the numbers behind the code can lead you to exciting discoveries and opportunities in the world of open source.

Happy Coding!

1 comment on commit f360ae9

@vercel
Copy link

@vercel vercel bot commented on f360ae9 Mar 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.