Skip to content
Find and fetch user information with GitHub's API using plain javascript
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css
js
.DS_Store
.gitattributes
LICENSE
README.md
index.html
renovate.json

README.md

GitFinder

Find and Fetch user information with GitHub's API using plain javascript, only by entering a username.

Running the Project Locally

Clone the repository to your local machine:

git clone https://github.com/endormi/GitFinder.git

Application

First you must create an application, all you need to worry about for now is the url's. I personally used http://127.0.0.1:8080 for the site and webhook url (it's up to you).

More detailed explanation of the application url:

Homepage URL User authorization callback URL Webhook URL
http://127.0.0.1:8080 http://127.0.0.1:8080 http://127.0.0.1:8080

Once the application is created, you are provided with client id and client secret token which you then need to apply to your app.js file

const client_id = "your_token";
const client_secret = "your_token";

Install live-server

Get the server up and running (-g stands for global)

npm install live-server -g

To run the server

live-server

Using GitHub's API

To use GitHub's API, you obviously need to fetch the API from GitHub. (URL is continuous)

const fetchUser = async (user) => {
    const api_call = await fetch(`https://api.github.com/users/${user}?client_id=$
    {client_id}&client_secret=${client_secret}`);

A small part of GitHub's JSON code as an example

{
  "login": "endormi",
  "url": "https://api.github.com/users/endormi",
  "html_url": "https://github.com/endormi",
  "followers_url": "https://api.github.com/users/endormi/followers",
  "following_url": "https://api.github.com/users/endormi/following{/other_user}",
  "gists_url": "https://api.github.com/users/endormi/gists{/gist_id}",
  "repos_url": "https://api.github.com/users/endormi/repos",
}

ONLY For Public Repositories

License

The source code is released under the MIT License.

You can’t perform that action at this time.