[TW5] Word count hack

347 views
Skip to first unread message

Jeremy Ruston

unread,
Mar 3, 2015, 2:29:22 PM3/3/15
to TiddlyWiki
Here's a quick and dirty hack to count the number of words in the tiddlers with a particular tag in TiddlyWiki 5:


It counts the number of words in the raw text, not the wikified output.

Best wishes

Jeremy

--
Jeremy Ruston
mailto:jeremy...@gmail.com

James

unread,
Dec 2, 2015, 12:29:23 AM12/2/15
to TiddlyWiki, Tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy,

Any idea how to use this in TW5?
Sorry for the stupid question.  I am looking forward for a copy and paste solution.  Thanks.

Jeremy Ruston

unread,
Dec 2, 2015, 9:48:28 AM12/2/15
to James, TiddlyWiki
Hi James

Any idea how to use this in TW5?
 
Sorry for the stupid question.  I am looking forward for a copy and paste solution.  Thanks.

The instructions that you linked to apply to TiddlyWiki5. Have you tried those steps and encountered a problem, or are you looking for a different solution?

Best wishes

Jeremy.


 



On Wednesday, 4 March 2015 03:29:22 UTC+8, Jeremy Ruston wrote:
Here's a quick and dirty hack to count the number of words in the tiddlers with a particular tag in TiddlyWiki 5:


It counts the number of words in the raw text, not the wikified output.

Best wishes

Jeremy

--
Jeremy Ruston
mailto:jeremy...@gmail.com

James

unread,
Dec 6, 2015, 10:09:10 PM12/6/15
to TiddlyWiki, jimmy....@gmail.com, jeremy...@gmail.com
Hi Jeremy,

My question is where I need to paste this "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" script in my TW in order to use the word count.  Thanks

CL

unread,
Dec 7, 2015, 3:07:42 AM12/7/15
to TiddlyWiki, jimmy....@gmail.com, jeremy...@gmail.com
Hi James

You need to open your tiddlywiki with google chrome and press F12 to open development tool.
You will be able to see 'Console' next to 'Elements' at the top.
Copy and paste that script into there.
Don't forget to change 'mytag' to the tag you want to count word.

Best wishes

CL

2015년 12월 7일 월요일 오후 2시 9분 10초 UTC+11, James 님의 말:
Reply all
Reply to author
Forward
0 new messages