Skip to content

Instantly share code, notes, and snippets.

@jessehattabaugh
Created August 14, 2008 20:52
Show Gist options
  • Save jessehattabaugh/5487 to your computer and use it in GitHub Desktop.
Save jessehattabaugh/5487 to your computer and use it in GitHub Desktop.
function get_analyze_terms(){
printp("total:",storage.site.terms)
storage.terms.sort(lastAnalyzed).limit(40).forEach(function(t){
t.volume = (100 / storage.site.count) * t.count
if(t.volume > 0.1) t.relevant = false
else if(t.volume < 0.008) t.relevant = false
else t.relevant = true
storage.interests.filter({term:t}).forEach(function(i){
i.volume = (100 / i.user.count) * i.count
i.difference = i.volume - t.volume
if(i.volume > 0.1) i.relevant = false
else if(i.volume < 0.02) i.relevant = false
else i.relevant = true
i.analyzed = new Date()
})
t.analyzed = new Date()
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment