Giter Site home page Giter Site logo

js-ajax-hitting-apis-lab-wework-eng-11-17's Introduction

JavaScript GitHub API with XHR

Objectives

  1. Practice making HTTP requests with XHR
  2. Practice doing things with XHR responses

Introduction

The GitHub API provides access to a lot of interesting and useful data that we can use with XMLHttpRequest to create our own applications that extend Github's functionality.

The documentation is extensive and well-organized. For instance, anything you can do regarding a Github repository will be under the Repositories section.

Each section is broken down by function, and tells you exactly what you need to know to request that API endpoint, including any URI parameters (denoted by colons in the parameter, like /repos/:username) you'll need to provide an example of the response JSON.

Read through the overview section to learn how to interact with the Github API. We won't be using any functions that require authentication, so don't worry about that too much yet. After that, read through the repositories section and get an idea of the types of things you can do with repository data.

Once you're done exploring, you'll put that knowledge to the test to create a simple repository browser. Follow the directions below to create a page that allows you to dynamically browse repositories, commits, and branches using XHR.

A basic HTML structure has been provided for you. Make sure to run tests and try it out in your browser to see it in action!

Instructions

  1. Create a form with a username field that calls a getRepositories function that loads the repositories div with a list of public repositories for that user. The displayed repositories should include the name and a link to the URL (HTML URL, not API URL).
  2. Add a link to each repository that calls a getCommits function on click and, when the request is complete, calls a displayCommits function that fills the details div with a list of commits for that repository. The display of commits should include the author's Github name, the author's full name, and the commit message. Give the link data attributes of username and repository to be used by the getCommits function.
  3. Add a link to each repository that calls a getBranches function when clicked and, when complete, calls a displayBranches function that fills the details div with a list of names of each branch of the repository. Give the link data attributes of username and repository for use by the getBranches function.

Resources

View GitHub API With XHR Lab on Learn.co and start learning to code for free.

js-ajax-hitting-apis-lab-wework-eng-11-17's People

Contributors

maxwellbenton avatar pletcher avatar gj avatar annjohn avatar bhollan avatar scottcreynolds avatar sgharms avatar achasveachas avatar

Watchers

 avatar James Cloos avatar  avatar Victoria Thevenot avatar  avatar Joe Cardarelli avatar Sara Tibbetts avatar The Learn Team avatar Cernan Bernardo avatar Sophie DeBenedetto avatar  avatar Antoin avatar  avatar  avatar Nicole Kroese  avatar Lisa Jiang avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.