Skip to content

Instantly share code, notes, and snippets.

@justinobney
Last active August 10, 2016 13:43
Show Gist options
  • Save justinobney/b59fa2787ca6f9d222a1 to your computer and use it in GitHub Desktop.
Save justinobney/b59fa2787ca6f9d222a1 to your computer and use it in GitHub Desktop.
Hacker News - Who is hiring trends
var clientSide = [
'javascript',
'elm',
'ember',
'angular',
'jquery',
'backbone',
'react',
'reactjs',
'clojurescript',
'typescript',
'aurelia'
];
var serverSide = [
'C#',
'Rust',
'GoLang',
'Python',
'DJango',
'Closure',
'Ruby',
'Haskel',
'Swift',
'node',
'nodeJS',
];
var mobile = [
'ios',
'android',
'React Native',
'Swift'
];
var comments = document.querySelector('.comment-tree')
var source = comments.innerText;
console.table(clientSide.map(function(term){
var matches = source.match(new RegExp(term, 'gi')) || [];
return {name: term, count: matches.length}
}));
console.table(serverSide.map(function(term){
var matches = source.match(new RegExp(term, 'gi')) || [];
return {name: term, count: matches.length}
}));
console.table(mobile.map(function(term){
var matches = source.match(new RegExp(term, 'gi')) || [];
return {name: term, count: matches.length}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment