Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edc1f71

Browse files
authored
Finished the HW
1 parent eda0765 commit edc1f71

File tree

1 file changed

+12
-35
lines changed

1 file changed

+12
-35
lines changed

Week6/MAKEME.md

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,15 @@
11
# Homework Week 6
2-
3-
UNDER CONSTRUCTION
4-
52
- Add your github/repositories link to the pinned slack file
63
- Fix the issues from the last week and make sure you explain how you fixed the issue in a comment (or commit message)
7-
8-
Write a script that [polls this API](https://sunrise-sunset.org/api) every 3 seconds and passes a new date everytime where date is previous day ++.
9-
Write a SPA that follows the pattern outlined in this [codepen](http://codepen.io/Razpudding/pen/MmVpeW).
10-
11-
12-
OLD HW
13-
Read through the JavaScript Fundamentals [README](https://github.com/HackYourFuture/JavaScript/tree/master/fundamentals) and make the [exercises](https://github.com/HackYourFuture/JavaScript/blob/master/fundamentals/exercises.md) hand in your answers in Trello.
14-
15-
ASK A QUESTION ON SLACK!!!!
16-
17-
## Homework from class
18-
Create a repo that makes this code work, implies an html file and a js file.
19-
```
20-
fetchReposFromOrganization('hackyourfuture')
21-
.then(renderListOfRepositories)
22-
.then(fetchContributors)
23-
.then(renderContributors);
24-
```
25-
26-
Make sure you authenticate the request with a **token**, [Create a new token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/).
27-
You should be able to achieve with somenthing like:
28-
```
29-
request.setRequestHeader("Authorization", "token " + TOKEN);
30-
```
31-
32-
**IMPORTANT REQUIREMENT**
33-
*We're assuming that you know that **TOKEN is a precious piece of data**.
34-
You've to make sure that you **never publish your TOKEN** openly!*
35-
36-
*Tip:*
37-
A way of solving, could be, creating an input where I to fill the personal token. Maybe use [Local Storage](https://developer.mozilla.org/en/docs/Web/API/Window/localStorage) so when we come back is already set.
38-
You can find also start to look at stuff like: [How to get value from input](http://stackoverflow.com/questions/11563638/javascript-how-to-get-value-of-text-input-field).. etc...
4+
- Write a script that [polls this API](https://sunrise-sunset.org/api) every 3 seconds and passes a new date everytime where date is previous day ++.
5+
6+
### Main assignment
7+
You are going to write a SPA that uses the [Github API](https://developer.github.com/guides/getting-started/). Make sure that your app uses a logical pattern just like [this codepen](http://codepen.io/Razpudding/pen/MmVpeW).
8+
9+
1. Make a call to 'https://api.github.com/users/' + userInput (where userInput is a string typed into a searchfield by a user). You can do this by using some of the code of the previous week. Look at the response data.
10+
2. show the users name, avatar image (not the link to the image!) and the number of public repos they have
11+
3. When clicking on the users name, show all the other info you have about that user. When clicking on the avatar image, open their github profile in a new tab. When clicking on the number of public repos, make another API call to 'https://api.github.com/users/user/repos' and build an unorderdered list of the returned repos with just the name of each repo.
12+
4. When hovering over the name of the repo, show on the right side of the page in an `<aside>` element the description of that repo, when it was created, and the number of open issues it has.
13+
5. Change the function your previously wrote that handles the hovering event and add functionality to it that shows the collaborators of that repo. Note: to do this, you will need to make ANOTHER API call to https://api.github.com/repos/user/repo/events and that lists the 3 last events. Show the type of the event and if the type is 'PushEvent' show the commit message. Take a look at this [API call](https://api.github.com/repos/Razpudding/realtime-slack/events) to see some sample data.
14+
6. Make sure that when a user goes to your app, your github account info is loaded. They can then use the search field to find info about other github accounts.
15+
7. BONUS: Look through the data that Github sends back to you on your first API call and think about what other info would be usefull. Add more functionalities to your app like showing how many people starred a repositories or showing the names of the people followed by the current user.

0 commit comments

Comments
 (0)