Counting words for the sidebar

by Dave on 5-Nov-09 · 4 comments

in NaNoWriMo 2009, This Blog

Katherine’s been envious of the little graph I can pull up on my NaNoWriMo page (under the NaNo Stats tab), so Margie created one for her in Google Sheets, and I’ve put a link to the graph in the sidebar under her name.   Yay for Google Docs (and Margie).

The official NaNoWriMo word count widgets are still not turned on, due to the site being so slammed.  Eric at Saalon Muyo has created a simple PHP hack that uses the NaNoWriMo API to give the word count; I’m including that in my sidebar for my results, until (if ever) the widgets work.

Interestingly, the API and widgets are only on the “adult” side; Katherine’s YWP account doesn’t get access to them.  I’m not sure if that’s to keep the kids from being too obsessed over this or what, but it’s a bit irksome.

Print Print

{ 4 comments… read them below or add one }

1 Eric Sipple 5-Nov-09 at 11:53am

Glad to know the counter still works. I was wondering if they’d changed the API and broken it. In fact, when I saw I had a ping on my site I was half expecting to see “Well, this was a good idea, but it doesn’t work anymore…”

Relief!

Good luck on Nano this year!

Eric

Reply

2 Dave 5-Nov-09 at 12:13pm

Apparently works like a champ (though if I were a better PHP programmer I’d figure out how to format the output to include the thousands comma :-) ).

Reply

3 Eric Sipple 5-Nov-09 at 12:36pm

I was rushing through that last year because I was actually participating, and I didn’t notice I had missed that until after my amount of time to hack had passed.

Try this replacement for the display line:
echo(”I’ve written ” . number_format($result[10]) . ” of 50,000 words.”);

If that doesn’t work I’ll play some more.

Reply

4 Dave 5-Nov-09 at 2:06pm

Hmmm. Now it’s broken (shows 0). The API is working, though.

Reply

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: Human-Human-Computer Interface

Next post: Words, more (and less)