- Doing Write - http://www.hill-kleerup.org/blog/doingwrite -

Counting words for the sidebar

Katherine’s been envious of the little graph I can pull up on my NaNoWriMo page [1] (under the NaNo Stats tab), so Margie created one for her in Google Sheets, and I’ve put a link [2] 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 [3]; 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.

4 Comments (Open | Close)

4 Comments To "Counting words for the sidebar"

#1 Comment By Eric Sipple On 5-Nov-09 @ 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

#2 Comment By Dave On 5-Nov-09 @ 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 🙂 ).

#3 Comment By Eric Sipple On 5-Nov-09 @ 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.

#4 Comment By Dave On 5-Nov-09 @ 2:06pm

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