Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenge 4 Done #38

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Name

write-your-name
Logan Bates

# How many points have you earned?

0/100
100/100

(Make your own calculation and replace the number 0 with the points you think you've earned.)

# How many hours have you spent on this?

fill-in-your-answer
2.5

# What is the most difficult part about this week's challenge?

fill-in-your-answer
Trying to figure out how to get my refine to work on my linux distro. Java wasn't set up correctly.

# Show and tell

## Link (3 points)

[title-of-the-article](http://link-to-an-interesting-article-about-the-notion-of-quantified-self)
[Forget the Quantified Self. We Need to Build the Quantified Us](http://www.wired.com/2014/04/forget-the-quantified-self-we-need-to-build-the-quantified-us)

## How do you relate to this article personally? (3 points)

fill-in-your-answer
Everyone experiences instances of "Quantified Us" everyday through our usage of electronics. Our phones collect data to report traffic delays and accidents as well as general behavioral patterns. These methods have proven powerful and what the article discusses could help many people, like myself, with certain problems.

# API (II) (5 points x 4 + 8 points x 2 = 36 points)

Expand Down Expand Up @@ -72,54 +72,54 @@ fill-in-your-answer

### 1 (4 points)

![image](image.png?raw=true)
![image](checkpoint1.png?raw=true)

### 2 (4 points)

![image](image.png?raw=true)
![image](checkpoint2.png?raw=true)

### 3 (4 points)

![image](image.png?raw=true)
![image](checkpoint3.png?raw=true)

### 4 (4 points)

![image](image.png?raw=true)
![image](checkpoint4.png?raw=true)

### 5 (4 points)

![image](image.png?raw=true)
![image](checkpoint5.png?raw=true)

## Challenges (4 points x 7 + 10 points x 1 = 38 points)

### 1 (4 points)

![image](image.png?raw=true)
![image](challenge1.png?raw=true)

### 2 (4 points)

![image](image.png?raw=true)
![image](challenge2.png?raw=true)

### 3 (4 points)

![image](image.png?raw=true)
![image](challenge3.png?raw=true)

### 4 (4 points)

![image](image.png?raw=true)
![image](challenge4.png?raw=true)

### 5 (4 points)

![image](image.png?raw=true)
![image](challenge5.png?raw=true)

### 6 (4 points)

![image](image.png?raw=true)
![image](challenge6.png?raw=true)

### 7 (4 points)

![image](image.png?raw=true)
![image](challenge7.png?raw=true)

### 8 (10 points)

![image](image.png?raw=true)
![image](challenge8.png?raw=true)
Binary file added challenge1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenge8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkpoint5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion github1.js
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
// TODO:
var rest = require('restler');

rest.get('https://api.github.com/repositories').on('complete', function(results) {
if (results instanceof Error) {
console.log('Error:', results.message);
this.retry(5000);
}
else {
console.log(results);
}
});
11 changes: 10 additions & 1 deletion github2.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
// TODO:
var rest = require('restler');

rest.get('https://api.github.com/orgs/CSCI-4830-002-2014/repos').on('complete', function(results) {
if (results instanceof Error) {
console.log('Error:', results.message);
this.retry(5000);
} else {
console.log(results);
}
});
11 changes: 10 additions & 1 deletion github3.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
// TODO:
var rest = require('restler');

rest.get('https://api.github.com/repos/CSCI-4830-002-2014/challenge-week-1/forks').on('complete', function(results) {
if (results instanceof Error) {
console.log('Error:', results.message);
this.retry(5000);
} else {
console.log(results);
}
});
11 changes: 10 additions & 1 deletion github4.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
// TODO:
var rest = require('restler');

rest.get('https://api.github.com/repos/CSCI-4830-002-2014/challenge-week-1/pulls?' , "state = closed").on('complete', function(results) {
if (results instanceof Error) {
console.log('Error:', results.message);
this.retry(5000);
} else {
console.log(results);
}
});
25 changes: 24 additions & 1 deletion github5.js
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
// TODO:
var rest = require('restler');
var async = require("async");


function getClassEventsForPage(i, callback){
var page = 'https://api.github.com/orgs/CSCI-4830-002-2014/events?page=' + i;
restler.get(page).on('complete', function(data) {
console.log(data);
});
};

function flatten(input) {
var flattened = [];
for (var i = 0; i < input.length; ++i) {
var current = input[i];
for (var j = 0; j < current.length; j++) flattened.push(current[j]);
}
return flattened;
}

async.map([1,2,3,4,5,6,7,8,9,10], getClassEventsForPage, function(err, results) {
flattened = flatten(results);
console.log(JSON.stringify(flattened, undefined, 4));
});
18 changes: 17 additions & 1 deletion github6.js
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
// TODO:
var rest = require('restler');
var postTitle = {
"title" : "IssueChallenge4",
}
var login = {
"username" : "LoganBates",
"password" : "Filler"
}

rest.postJson('https://api.github.com/repos/CSCI-4830-002-2014/challenge-week-4/issues', postTitle, login).on('complete', function(results) {
if (results instanceof Error) {
console.log('Error:', results.message);
this.retry(5000);
} else {
console.log(results);
}
});
24 changes: 23 additions & 1 deletion github7.js
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
// TODO:
var rest = require('restler');
var async = require('async');

function getClassEventsForPage(i, callback) {
var pageIter = 'https://api.github.com/orgs/CSCI-4830-002-2014/events?page=' + i;
rest.get(pageIter).on('complete', function(data) {
console.log(data);
});
};

function flatten(input) {
var flattened = [];
for (var i = 0; i < input.length; ++i) {
var current = input[i];
for (var j = 0; j < current.length; j++) flattened.push(current[j]);
}
return flattened;
}

async.map([1,2,3,4,5,6,7,8,9,10], getClassEventsForPage, function(err, results) {
flattened = flatten(results);
console.log(JSON.stringify(flattened, undefined, 4));
});
4 changes: 4 additions & 0 deletions node_modules/restler/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions node_modules/restler/MIT-LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading