It could work (sort of), but not in this manner (The execution-time of a script is limited and the connection could time out, and noone wants to wait for the last message to come in last).
You should write the script to display the last X messages, and refresh each X seconds. That would work. But it is quite inconvenient.