Small pony: ongoing word count on Mefi posts November 5, 2019 12:18 PM   Subscribe

Since the site suggests you move content from the question to extended explanation once it hits 100 words, would it be possible to add a widget that shows you how many words are in your question currently (like Twitter does for character count)? That would have the added benefit of being able to warn a user when they are reaching their word limit within the 'post' page rather than requiring a click through to the 'preview post' section.
posted by softlord to Feature Requests at 12:18 PM (19 comments total) 2 users marked this as a favorite

I can go either way on this. I wasn't able to find anywhere where we'd discussed this before, so am curious if it's something that people are actually looking for as a feature.
posted by frimble (staff) at 12:25 PM on November 5, 2019

Out of curiosity, does it count HTML “words” too?
posted by Kattullus at 1:07 PM on November 5, 2019 [1 favorite]

As in tags, Kattullus?
posted by brundlefly at 2:20 PM on November 5, 2019

Whether the HTML code is included in the word count for above-the-fold length.
posted by Kattullus at 2:27 PM on November 5, 2019

If you're going to count words one way or another, then also add the 'has a link' test. I was surprised that you *have* to have a link in the above the fold bit somewhere. I'm guessing if you're counting spaces for words then the links/HTML wouldn't matter that much. But if you're doing characters / 5 or something then the links at least could eat that up pretty quickly.

Don't know if I'd need it, but I don't make that many FPPs anyways.
posted by zengargoyle at 2:36 PM on November 5, 2019

I would love this. I would rather devise a post with the active knowledge of how many words/characters I am using above the fold, for example, than to have to do a bit of back-and-forth trial-and-error to make sure it's not triggering the "this is too long" message.

It's a small thing, for sure, and yes, we have survived without it this long, but it would be very helpful to have. I am all for this feature as long as frimble feels it's doable/doesn't involve unreasonable levels of work to achieve.
posted by nightrecordings at 2:59 PM on November 5, 2019 [5 favorites]

Sone people use the warning as more of a suggestion than a hard limit. A guideline, if you will.

So I'm told.
posted by Johnny Wallflower at 3:08 PM on November 5, 2019 [7 favorites]

Sone people use the warning as more of a suggestion than a hard limit. A guideline, if you will.

So I'm told.

See Johnny ol buddy ol pal- i don't know if you're throwing shade at me or yourself but gods know we both deserve it.
posted by Homo neanderthalensis at 3:15 PM on November 5, 2019 [6 favorites]

There is a 100 word limit suggestion? I just break wherever it makes sense, at around 1 paragraph.
posted by COD at 4:02 PM on November 5, 2019 [1 favorite]

I prefer to avoid downloading JavaScript code unless it's really necessary.
posted by amtho at 8:00 PM on November 5, 2019 [1 favorite]

I would hop on this pony if it were around. I always write posts in my text editor first and always forget about the 100-word guideline. (But I also do not post a lot.)

Actually just saw the over 100-word warning when creating an Ask post the other day, and I used the word count on my text editor to edit down the front page paragraph to exactly 100 words, and I still got the warning when previewing. There was no HTML markup in the paragraph (a " - " hyphen by itself counted as a word but that's normal). I had to trim the paragraph down to 94 words (according to Geany, the text editor) in order for the warning to go away on preview.

So, I'm not sure if there's a discrepancy in how MeFi counts words as opposed to Geany, or if the threshold for displaying the warning needs to be increased to match the text of the warning.
posted by rangefinder 1.4 at 9:41 PM on November 5, 2019

Hi frimble - here's a related request five years ago from codacorolla, who suggested it didn't have to be a dynamic countdown and could be an enhancement of the warning message itself.
posted by rangefinder 1.4 at 9:51 PM on November 5, 2019

First of all, this is a question about Ask, not Mefi. Ask gives a warning when the part of the question shown before clicking inside is more than 100 words.

In this case, words are defined in the simplest possible way, namely “a collection of letters or things that might be letters” so a HTML link like <a href=“”>I wasn’t able to find what I wanted here.</a> is going to be 6 words longer than expected because of tags and URLs.

My inclination would be to give a warning while typing when the question gets verbose – and maybe revisit the warning text – rather than having an exact (and imperfect) word count ticking up on the screen while you type.
posted by frimble (staff) at 10:24 PM on November 5, 2019 [2 favorites]

Good to know this warning is only for Ask. I was thinking that TITLE or ABBR text could easily be longer than the actual visible part of a post but I don't use those in Ask posts.
posted by Mitheral at 4:09 AM on November 6, 2019

There is a 100 word limit suggestion? I just break wherever it makes sense, at around 1 paragraph.

This. ☝🏼

Doesn’t need to be coded.
posted by terrapin at 4:50 AM on November 6, 2019

This ought* to have fairly minimal impact in terms of download weight. I would expect it to be around 1 KB uncompressed. Here’s a very crude and ugly 310 byte pure JavaScript implementation that can be pasted into the developer console.

(This does not prevent the form from working when JavaScript is disabled.)

It’s probably easier to make the word count accurate client-side than server side, since client side HTML rendering is trivial. Just render the text in a hidden element, then count words in the rendered text. (Dealing with “words” like “—” is also quite straight forward.)

Caveats abound.
$("#comment").after('<div id="comment-word-count">0 words</div>');

$("#comment").keyup(function () {
  var isWord = function ( word ) {
    return word != "";
  var words = this.value.split(/\s+/).filter(isWord);
  $("#comment-word-count").text(words.length + " words");
* I do not work on MetaFilter. I do have significant experience writing web apps.
posted by danielparks at 2:37 PM on November 6, 2019 [1 favorite]

If you're concerned about the length of your question, then it's already too long and needs some text in the extended explanation.

Alternatively, count a line in the text box and estimate. Using the ITU standard word "paris" (it's the standard for word length in Morse code) I get 19 words per line here. So if I'm into my sixth line, I should probably have gone extended.
posted by scruss at 3:10 PM on November 6, 2019 [1 favorite]

Prescribing ways to make all posts conform to a style (even as innocuous as this) doesn't improve the site.
posted by mzurer at 6:29 AM on November 9, 2019

The proscription already exists, I'm just suggesting a way to make it more apparent when you are reaching the threshold. For those with JS concerns, I can only imagine that if you don't have JS enabled the site will continue to behave as it always has.
posted by softlord at 8:50 PM on November 10, 2019

« Older We should stop linking to the NY Times   |   MetaWhatYouLikedAboutToday Newer »

You are not logged in, either login or create an account to post comments