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

Skip to content

Commit cc754f0

Browse files
committed
updated homework week6
1 parent dcfc266 commit cc754f0

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

Week6/MAKEME.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,15 @@
22

33
>[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week6/README.md) you find the readings you have to complete before the fourth lecture.
44
5-
### Step 0: Feedback
5+
### Step 1: Feedback
66

77
Give feedback on `step 3` of `week 5` to one of your fellow students (do this by creating issues in Github).
88

9-
### Step 1: Git
10-
11-
1. Create a branch called `MyBranch` in the repository `MyFirst`.
12-
13-
2. Create the files `leaf1.txt`, `leaf2.txt`, `flower.txt` and `fruit.txt` and write some content in them.
14-
15-
3. Create a corresponding remote tracking branch on GitHub and push this branch to the Github remote you just created.
16-
17-
4. Merge `MyBranch` with the `master` branch
18-
199
### Step 2: Fix issues and API
2010

2111
- Fix the issues from the last week and make sure you explain how you fixed the issue in a comment (or commit message)
2212
- Write a script that [polls this API](https://sunrise-sunset.org/api) every 3 seconds and passes a new date every time where date is previous day ++.
2313

24-
2514
### Step 3: SPA :sweat_drops:
2615
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).
2716

@@ -50,10 +39,11 @@ https://api.github.com/repos/HackYourFuture/CommandLine
5039
7) Make a function which takes a single argument. The function should make an XHR request to `https://api.github.com/repos/HackYourFuture/[SearchTerm]` where the search term will be the argument. This argument will be the input the user has given you, so make sure that when the user clicks the button you call this function with the argument.
5140

5241
8) 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.
42+
5343
- Make sure you handle user input well. That means you need to think about empty input, and input that doesn't yield any results.
5444

5545
So Github has this really nice documentation :octocat: :
56-
Check these out for exmple
46+
Check these out for example
5747
https://developer.github.com/v3/repos/collaborators/
5848
https://developer.github.com/v3/repos/commits/
5949

@@ -69,15 +59,29 @@ https://developer.github.com/v3/repos/commits/
6959
So based on your users actions (input, hovering, clicking) you want to call `makeRequest` with a different `url` and supply it with a function that handles both errors (display an error message to the user for example) and responses (render it correctly, as described below).
7060
- Make your functions small and reusable (modular)! That means create separate functions to handle certain steps.
7161

72-
>TODO
62+
11) GO WILD
63+
64+
Again, check out the Github API documentation to see what kind of magic stuff you can do with it.
65+
66+
The assignment is to implement something extra that is not in the assignment :scream: (nice and vague right?)
67+
68+
So for example, we have teams in our organization. You can find out who are in there and make a call to 'https://api.github.com/users/' + userInput (where userInput is a string typed into a search field by a user). You can show the users name, avatar image (not the link to the image!) and the number of public repos they have. Or you could make an API call to 'https://api.github.com/users/user/repos' to find out the public repo's they have. Or you can show how many people starred a specific repository.
69+
70+
Anyway, endless fun and possibilities. Need inspiration, check out the Github API documentation. Oh and please make it look nice (hint: use the stuff you learned in HTML/CSS)!
71+
72+
73+
### Step 1: Git
74+
75+
> Unmesh will assign you with Git homework later this week
76+
77+
<!-- 1. Create a branch called `MyBranch` in the repository `MyFirst`.
78+
79+
2. Create the files `leaf1.txt`, `leaf2.txt`, `flower.txt` and `fruit.txt` and write some content in them.
80+
81+
3. Create a corresponding remote tracking branch on GitHub and push this branch to the Github remote you just created.
82+
83+
4. Merge `MyBranch` with the `master` branch -->
7384

74-
<!-- 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.
75-
2. show the users name, avatar image (not the link to the image!) and the number of public repos they have
76-
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 unordered list of the returned repos with just the name of each repo.
77-
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.
78-
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.
79-
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.
80-
7. Look through the data that Github sends back to you on your first API call and think about what other info would be useful. 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. -->
8185

8286
__Bonus__: Write a function takes this array `['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c']` and returns an array which only has unique values in it (so it removes the duplicate ones). Make it a 'smart' algorithm that could do it for every array (only strings/number). Try to make it as fast as possible!
8387

0 commit comments

Comments
 (0)