https://github.com/jgc777/githubrepoapi
Get a list of the GitHub repos of a given user
https://github.com/jgc777/githubrepoapi
github html javascript utility
Last synced: 3 months ago
JSON representation
Get a list of the GitHub repos of a given user
- Host: GitHub
- URL: https://github.com/jgc777/githubrepoapi
- Owner: jgc777
- License: other
- Created: 2025-01-13T18:13:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-26T19:02:30.000Z (about 1 year ago)
- Last Synced: 2025-05-26T20:19:41.102Z (about 1 year ago)
- Topics: github, html, javascript, utility
- Language: HTML
- Homepage: http://jgc.linkpc.net/GitHubRepoAPI/
- Size: 386 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHubRepoAPI


[](./LICENSE)
Get the github repos of a user, with more options. It doesn't want to show all the repos if they are more than 30. If I fixed it it wouldn't work without an API key. I know the appendRepos() works but I don't know if the API ones completely work.
## How to use it
Just load [the script](./api.js) and do `appendRepos(a, b);` (or use [the simplified edition](./#simplified-edition)).
> [!IMPORTANT]
> Each IP has a GitHub API rate limit of 60 requests per hour.
### Example
```html
const token = 'YOUR_API_KEY'; // Your API key with public repos read access
appendRepos("YOUR_GH_USERNAME", repo-list); // Call appendRepos
```
### Simplified edition
> [`simplified.js`](http://jgc777.github.io/GitHubRepoAPI/simplified.js)
```html
```
It's a simplified version of the code with no sorting and which automatically appends the repos to the repo-list list element (`
## Functions
Here are the functions that this program includes.
### appendRepos(username, repoListElement)
Appends the repos of a given username to a list, with the links to them ordered by pinned and starcount.
### getReposbyUsername(username)
Returns a (not sorted) list of all the repos for a given username.
### getSortedRepoList(username)
Returns a (sorted by pinned and starcount) list of all the repos for a given username.
### IsPinned(owner, repo)
> Needs an API key, else returns false.
Return if (true/false) a repo is pinned in the owners profile.
### starCount(owner, repo)
> Needs an API key, else returns 0.
Returns the starcount of a given repo.
## Demo
Only availabe on the web!
If it doesn't work click [here](./demo/).
Error loading the demo
## Simplified Version Demo
Only availabe on the web!
If it doesn't work click [here](./demo/simplified/).
Error loading the simpliified demo