7 ms·
Show HN: WordCount.is
- joelrunyon 14y agoThis is my first ever endeavor into some sort of programming. I use evernote or textedit to write a lot posts or guest post and there's not always a quick way to check word count before I send them off. In addition, a lot of wordcount sites out there were ugly, hard to use or filled with ads. I know it fills a really, really small niche need, but I was pretty happy I could put it together in a few hours, solve a small problem and learn something about programming at the same time. Now, to move on to bigger projects!
- markszcz 14y agoThis is what I see in case it differs from you: http://imgur.com/jhjSV http://imgur.com/jhjSV Im on Windows 7 using Chrome. Personally I feel as though the gray box explaining what the page is, is taking up most of the page. Any way to make it smaller? This way I feel as though it would remove any scroll bars on the page and prominently show your "WordCount.is is a useful web utility by Joel Runyon" Other then that, page looks clean and is simple to use.
- joelrunyon 14y agoThanks for the feedback. I'll see what I can do.
- 5xz41s0P8T5N 14y agoI actually expected the word count to show up in the grey area, I think it would look nice.
- joelrunyon 14y agoHey Mark, Went back through and cleaned things up. Thanks for the suggestion!
- zrail 14y agoYou should check out Marginalia, my web-based markdown editor with live word counts. We even use the same bootswatch theme :) https://www.marginalia.io https://www.marginalia.io
- aaronblohowiak 14y agothe text on your buttons isn't centered vertically
- zrail 14y agoWeird, they were fine yesterday. I'll take a look. Thanks!
- joshellington 14y agoGreat start for a first endeavor. Couple notes: - Would definitely recommend rethinking the header/banner area. Takes up a lot of vertical space and seems unnecessary for such a simple tool. - You're loading jQuery twice. Recommend removing that second version (line 14). - http://wordcount.is/js/jquery.center.js http://wordcount.is/js/jquery.center.js is returning 404 and doesn't seem needed (line 12). - It's best practice to cache your selectors for re-use in jQuery. Here's a slight rewrite that does that and cleans up your event binding: https://gist.github.com/3764620 https://gist.github.com/3764620 Happy hacking!
- joelrunyon 14y agoHey Josh, I went ahead and implemented all of your suggestions (I think). Seems to be a little bit faster! Thanks.
- joelrunyon 14y agoThanks for all the support and suggestions everyone. I've gone ahead and implemented several of the suggestions. You can check it out here --> http://wordcount.is http://wordcount.is Thanks again for the support and programming help!
- erichocean 14y agoAs a funny little anecdote, I know of a Mac word processor company that, as a tiny update, added a live word count feature to their product. Sales shot up 30%. It turns out that a number of people who write for a living need to hit hard word count limits, and were willing to pay for a product that had that feature. The dev I know who added the feature said he spent all of 15 minutes on it.
- deleted 14y ago[deleted]
- joelrunyon 14y agoI'm surprised at how many people leave this out. It's a simple function that most writers/editors use, but for some reason lots of writing applications leave out.
- robertduncan 14y agowc(1) to the rescue! :)
- zrail 14y agoPretty cool. Congrats on releasing!
- joelrunyon 14y agoThanks zrail!
- steve8918 14y agoFor a first venture into programming, this was nicely done! One thing, I thought the definition of a "word" is something like 6 characters, so a really long word could be considered 2+ "words". It seems like your definition of a word is a set of strings separated by a space. Is this intentional?
- joelrunyon 14y agoHey Steve, I'm not aware of that definition. Hmm...Would have to have a link to that definition? I guess tweak the script pretty simply if that's the case. But yes, to answer your question, this is a word count as defined by spaces between words.
- binarysolo 14y agoOff-the-cuff thoughts: is a number (say "12") a word? Is a hyphen -- used, say, like this -- a word? They count as 'em in your webapp, but I'd be curious what the official definition of word actually entails.
- joelrunyon 14y agoI think it depends on your definition, but broadly, yes, I would say most would count "12" as a word.
- anjc 14y agoI don't mean to be condescending, but you're not thinking of a 'word' as in, a 'word' in computer architecture are you? I'm pretty sure a word doesn't have to be six characters, but i could be wrong...
- GraffitiTim 14y agoYou're thinking of calculating touch typing speed in WPM, where the standard is to consider a "word" to be 5 characters.
- hnriot 14y agosince when did words of more than 6 characters become two words!!!!! That is so bizarre.
- PuercoPop 14y agoNice but I think it is a little bit lacking on the feature side even for a pet project. As others point out there are already a ton of ways to obtain a word count. Maybe you add value by providing a frequency chart of words?
- joelrunyon 14y agoIt's not really supposed to have a lot of "features." It's a single-purpose site – find your basic word count. It took me a few hours and taught me a little about programming. I view it much more as a stepping stone to understanding development and programming than as a full-time business project.
- sidcool 14y agoCongrats on your first project. Useful features: 1. Detect whitespaces in count 2. Count of a specific word/character in the text
- joelrunyon 14y agoGood ideas. I'll see if I can figure that out!
- electic 14y agoWhy is this a service and not a .js file?
- dag11 14y agoThe TLD is .is, in case you thought it was .js.
- veemjeem 14y agoI think he's asking why this is a website, and not just a simple javascript library that others can use.
- joelrunyon 14y agoI figured, for people like me with no coding or programming background, a single-use website would be more useful than a library that people would have to set up themselves. Plus, while I know about GitHub, I haven't really spent too much time on it to really know how it works.
- makepanic 14y agoIt's pretty easy to do in javascript. Made a Gist with a simple example https://gist.github.com/3764261 https://gist.github.com/3764261
- platz 14y agoThe gist isn't quite as interactive.
- peacemaker 14y agoI have to agree. I mean, it's nice and all but really it's a function you can write in a few minutes. I don't think it needs a website and a submission to HN.
- platz 14y ago
- thomasfrank09 14y agoNice first project Joel! Evernote is one of the rare programs that's very much inferior on the Mac, as the Windows version DOES have a word count feature. I'm really not sure why the team can't include it on the Mac version.
- joelrunyon 14y agoThanks Thomas. I love Evernote, but this is one of the minor details that could be improved.
- msarnoff 14y agoEvernote for Mac has had word count for several months now. Click the "i" button, the popover shows the size of a note, and its word and character counts.
- ssazesh 14y agoGood stuff Joel! This is clean.
- joelrunyon 14y agoThanks man! :)
- skymt 14y agoWhile already quite clean, your JavaScript can be simplified somewhat. split() will take a regular expression: var wordCount = value.trim().split(/\s+/).length Additionally, JavaScript's regex dialect has a special character of "\W", which matches any non-word character. So if you split on "\W+" instead, you ought to get a more reliable list of words, eliminating cases like "foo -- bar" counting as 3 words.
- joelrunyon 14y agoThanks Skymt. I'll implement that this weekend. Thanks for the tips.
- ThomasQue 14y agoI was wondering what a word (in a word count) was, thinking like you that "foo -- bar" was only two words, just like "foo-bar" or "foo/bar". So I started two widely used word processors and got surprising results : "foo -- bar" is actually considered 3 words long in both Microsoft Word 2007 and LibreOffice Writer 3.6.1.2, but "foo-bar" and "foo/bar" are 1 word long. There seems to be no standard as to what a word is in this context : Different word counting programs may give varying results, depending on the definition of "word", on the text segmentation algorithms, and on whether words outside the main text such as footnotes or hidden text are counted. [1] Anyway it seems a consensus to say that "foo -- bar" is 3 words long, so wordcount.is does give a not so wrong answer after all. [1] http://en.wikipedia.org/wiki/Word_count http://en.wikipedia.org/wiki/Word_count
- joelrunyon 14y agoHey Skymt, I implemented the first part of your suggestion and it worked well. However, when I tried to implement the \W, it gave me a very different count. When I checked it against Microsoft's Word's count for block of lorem ipsum text, the original function matched it exactly. Any thoughts as to what happened?
- jaredsohn 14y agoI was going to suggest making a browser extension out of this, but after some searching see that it has been done before. (On Chrome: https://chrome.google.com/webstore/detail/kmndjoipobjfjbhocpoeejjimchnbjje https://chrome.google.com/webstore/detail/kmndjoipobjfjbhocp...). This seems useful for people who 1) are not programmers, and 2) either are running a browser where there is no such extension, aren't interested in installing extensions, or have a one-off need.
- ruswick 14y agoFor whatever reason, this counts prefixed whitespace as a single word.
- drewschrauf 14y agoVery clean design and targets the niche nicely. One of my pet peeves is broken wordcounts though. A single space registers on your site as 1 word. Can I suggest checking out my post about javascript wordcounts? http://drewschrauf.com/blog/2012/06/13/javascript-wordcount-that-works/ http://drewschrauf.com/blog/2012/06/13/javascript-wordcount-...