Friday, May 22, 2020

Chrome Extension for the Checker!

Chrome extension for the header


What is a Chrome extension?

A browser Extension is a small software module for customizing a web browser. These typically allow a variety of extensions such as user interface modifications, ad blocking, and cookie management. Browser plug-ins are a separate type of module. The main difference is that extensions are usually just source code, but plug-ins are always executable. In 2019, plug-ins have become deprecated by most browsers, while extensions are widely used. The most popular browser, Google Chrome, has thousands of extensions available but only one plug-in, which is the Adobe Flash Player that is disabled by default.

How do I implement a browser extension?


First thing to do is to go the browser settings.

After you select the browser settings you look for the option {more tools} and then browser extensions.


And finally you select which extension to apply to the web browser.



The Checker extension for the web browser

For this HackDay project we decided to create a web browser extension that will return a pop-up message when we run the application. For this we first must take a look on how it works. 


1. Get the Project ID. We can get the project ID from any URL of the Holberton Projects, which is this number.


2. Place it on the box below.

3. Enjoy an encouraging message or a kinda mean one depending on how many tasks you have completed successfully.



Remember to on enter valid project ids for this extension, otherwise it will return a message stating that the argument entered was not a valid project id. Also check out our youtube video tutorial on how the extension works at (https://www.youtube.com/watch?v=UPWtgr63flI&feature=youtu.be)



How does it work?

Now that you know how the extension works, lets talk about whats going on behind the scenes. First we need the access to the Holberton API. To obtain access to the Holberton API you will need its API key. This will let us access the Holberton database in order to retrieve all the elements that we need such as: Email, password, scope and authentication. The authentication on the API is done by requesting an auth_token and use it in every request.

After we get the API key we are going to look into your profile for an authentication token, this will let us access the different projects you have completed in order to use the browser extension. The application access details in your profile such as git hub username or twitter. After gathering the data it converts it to JSON format in order to use it in the next step.

The next step is to use this JSON data to find the project id. We mentioned before that we need the project id to view the project itself and its tasks. All tasks in projects contain a unique ID which is linked to information with the Checker. The Checker is a tool used by Holberton to automatically correct project tasks and assign a grade depending on the percentage of tasks completed.

So how does the above link to the extension?

Using all the compiled information from the Holberton Database, we use this information and to assign values to our own database containing different messages that will display once the project ID has been requested by the extension. The application compares the argument entered with the data gathered and will return a pop-up. The pop-up message will depend on the score assigned to the project. We have a list of messages assigned with values, these values will be chosen at random depending the score threshold. For example if you have achieved a 100% score on a project the extension will return a pop-up with the message: "You are Awesome!" but if your score is less than 100% the messages will go from positive messages to once encouraging to try to resolve the issues you may have during that project.

As of us making this blog-post the extension is not completed, there are several bugs to be fixed. We had hope to finish it as of the day this blog-post is being published but we had to pivot and made an actual website instead. You can download the files for this website at (https://github.com/nhlshstr/holberton_checker_resposnse_generator)

Thanks for Reading!

Authors:

  • Kevin Apostol
  • Christine Pang
  • Travis Bearden
  • Trevor Stevenson
  • Ariana Bibiano
  • Nehal Shastri
  • Andres Cheung