Skip to content

Instantly share code, notes, and snippets.

@leplay
Created September 3, 2016 11:43
Show Gist options
  • Save leplay/f94c696cc6cd50421ef05adf82d4e521 to your computer and use it in GitHub Desktop.
Save leplay/f94c696cc6cd50421ef05adf82d4e521 to your computer and use it in GitHub Desktop.
var counter = {};
var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
_.each(dayNames, function(name) {
counter[name] = 0;
})
$.ajax({
url: 'https://www.producthunt.com/frontend/collections/the-1000-club?id=the-1000-club'
}).done(function(resp){
_.each(resp.collection_posts, function(item) {
var date = new Date(item.post.created_at);
counter[dayNames[date.getDay()]] += 1;
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment