Skip to content

Instantly share code, notes, and snippets.

@danheberden
Forked from rmurphey/gist:1139984
Created August 11, 2011 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danheberden/1140036 to your computer and use it in GitHub Desktop.
Save danheberden/1140036 to your computer and use it in GitHub Desktop.
var cloud = '',
users = {};
$('.js-comment-container').each(function() {
var c = $(this),
author = c.find('.author .author a').text(),
body = c.find('.content-body').text(),
words = body.split(' ').length;
users[ author ] = users[ author ] || 1;
while (words--){
cloud += author + ' ';
users[author]++;
}
})
console.log(users);
@cowboy
Copy link

cowboy commented Aug 11, 2011

words = body.split(/\s+/).length ?

@danheberden
Copy link
Author

aye, good point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment