Skip to content

Instantly share code, notes, and snippets.

@Jermolene
Created March 3, 2015 19:13
Show Gist options
  • Save Jermolene/47f5607cbae2fb7a4376 to your computer and use it in GitHub Desktop.
Save Jermolene/47f5607cbae2fb7a4376 to your computer and use it in GitHub Desktop.
Word counting hack for TiddlyWiki 5.1.7
var tag="mytag";r="";$tw.wiki.each(function(t){if(t.hasTag(tag)){r=r+" "+(t.fields.text||"")}});r.trim().replace(/\s+/gi," ").split(" ").length
@alexhough
Copy link

how might this be used to restrict the number of words, like in Twitter.

user story: I am writing a pitch for my startup, it needs to be in a sentence of less than 30 words

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