I'm sorry to hear that this is continuing to be an issue for some folks.
Just to be clear, as soon as we became aware of this issue (which occurred *after* the book first appeared in print) we posted to this forum and also updated the front page of
http://programming.itcarlow.ie - the book's official support website. At the time, David's solution required a bit of extra work, but did indeed solve the issue. Also, our community of readers came up with other suggestions too, which helped, and I note with thanks that you have linked to these - we very much appreciate this.
We'd love to "fix" the chapter once and for all, but until a reprint occurs and/or O'Reilly indicates that such an activity is warranted, we are stuck with what we've got. :-(
I've stated in other entries in this forum that the real point of the Twitter exercise is not to be able to send a message to Twitter (the icing) but to be able to send data into functions as a parameter (the cake). If you get how the data/function/parameter mechanism works, then move on to the next chapter as the learning bit of "the Twitter chapter" is over.
Regards.
--Paul.