|
1 | 1 | ## Homework Week 5
|
2 | 2 |
|
3 |
| ->[Here](/Week5/README.md) you find the readings you have to complete before the sixth lecture. |
4 | 3 |
|
5 | 4 | ### Step 0
|
6 | 5 | All share a video or a resource (this can be a drawing, article or a pod cast) that was helpful for you the last few weeks with learning JavaScript. Please share this in the #teach-yourself channel in Slack. Also write as small note about what the resource i about and why you think it's so helpful (you can share more than one if you like).
|
@@ -94,26 +93,33 @@ Make a website that fetches (= to get) data asynchronously.
|
94 | 93 |
|
95 | 94 | 2) Add a button (e.g. 'click me') that when clicked `console.logs` 'you clicked me!'
|
96 | 95 |
|
97 |
| -3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/HackYourFuture/repos) (the one we used last week). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript) |
| 96 | +3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page](https://api.github.com/orgs/HackYourFuture-CPH/repos) (the one we used last week). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript) |
| 97 | +
|
98 | 98 |
|
99 | 99 | 4) Display the data that you get from the Github API on your web page.
|
100 | 100 |
|
101 | 101 | 5) Now link the two together: When you click the button -> get the data from the Github API and display it on your website
|
102 | 102 |
|
103 |
| -6) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab. |
| 103 | +6) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture-CPH/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab. |
104 | 104 |
|
105 | 105 | 7) BONUS: if you look at this:
|
106 | 106 |
|
107 | 107 | ```js
|
108 |
| -https://api.github.com/repos/HackYourFuture/CommandLine |
| 108 | +https://api.github.com/repos/HackYourFuture-CPH/CommandLine |
109 | 109 | ```
|
110 | 110 |
|
111 | 111 | You can see `CommandLine` in the URL. These are called "query parameters" and let us specify in detail what we want from the API. Play around with this. For example you can make two buttons that either get data for a specific repository, JavaScript or Node.js. Or go even more crazy and make users type in a search box 'JavaScript' and then send that to the API by changing the repository.
|
112 | 112 |
|
113 |
| -``` |
114 |
| -How to hand in your homework: |
115 |
| -• Create a new repository "hyf-javascript2". Also create a new folder "week5" inside this repository. |
116 |
| -• Upload your homework files inside the week4 folder and write a description for this “commit”. |
117 |
| -• Your hyf-javascript2/week5 should now contain the files of your homework. |
118 |
| -• Post the link on the slack channel and in the Google Form |
119 |
| -``` |
| 113 | +
|
| 114 | +### Step 4: Hand in Homework: |
| 115 | +Go over your homework one last time: |
| 116 | +
|
| 117 | +- Does every file run without errors and with the correct results? |
| 118 | +- Have you used `const` and `let` and avoided `var`? |
| 119 | +- Do the variable, function and argument names you created follow the [Naming Conventions](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/naming_conventions.md)? |
| 120 | +- Is your code well-formatted (see [Code Formatting](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/naming_conventions.md))? |
| 121 | +
|
| 122 | +If you can answer yes to the above questions then you are ready to hand if the homework: |
| 123 | +* Find the hyf-homework git repo (forked from [here](https://github.com/HackYourFuture-CPH/hyf-homework)) |
| 124 | +* Add your homework files in the Javascript/javascript2/week2 folder |
| 125 | +* To submit the homework use the link in the top of your classes slack channel. |
0 commit comments