Use switch and loop in parseDocument
Split part of parseDocument into parseViewtopic
Rename method variable id in Post