book

Report

As a class, we brainstormed and came up with a long list of further questions we can ask based on the "self-introduction" data. Out of these questions, our team chose to tackle on the following:

Who wrote the most for thier comment

return _.pluck(_.sortBy(data.comments, function(comment){
		return _.size(comment.body.split(""));
		}).reverse(), 'user.login');

[
 "Linenfelser",
 "nicolele",
 "94kazakov",
 "pail4944",
 "karisantos",
 "sumi6109",
 "willzfarmer",
 "KevinKGifford",
 "zhya215",
 "boanding",
 "calebhsu",
 "satchelspencer",
 "co-bri",
 "DomoYeti",
 "hswitte",
 "kjblakemore",
 "twagar95",
 "jocr1627",
 "SankethSukumarShetty",
 "tiro6090",
 "ZachLamb",
 "AndreyShprengel",
 "drewdinger",
 "fadhilfath",
 "Malaokia",
 "anbe6083"
]

Which student has been a member of GitHub the longest?

(This assumes that userIDs were assigned consecutively)

return _.first(_.pluck(_.sortBy((_.pluck((data.comments), "user")), "id"), "login"))
Result is
"willzfarmer"

Who has updated their comment?

return _.pluck(_.filter(data.comments, function(comment){
	return comment['created_at'] !== comment['updated_at'];
}), 'user.login');

[
 "KevinKGifford",
 "kjblakemore"
]

Who uses the most punctuation?

return _.chain(data.comments)
    .map(function(obj) {
        return [obj.user.login,
                obj.body.match(/[`~!@#\$%\^&\*\(\)_\+-=\[\]\\\{\}\|;':",\./<>\?]/g).length];
    })
    .sortBy(function(tup) {
        return tup[1];
    })
    .map(function(tup) {
        return tup[0];
    })

Results sorted least to most.

[
 "twagar95",
 "Malaokia",
 "fadhilfath",
 "hswitte",
 "ZachLamb",
 "jocr1627",
 "drewdinger",
 "tiro6090",
 "calebhsu",
 "sumi6109",
 "SankethSukumarShetty",
 "AndreyShprengel",
 "anbe6083",
 "willzfarmer",
 "nicolele",
 "kjblakemore",
 "co-bri",
 "zhya215",
 "94kazakov",
 "Linenfelser",
 "pail4944",
 "DomoYeti",
 "boanding",
 "KevinKGifford",
 "karisantos",
 "satchelspencer"
]