I seen a lot of hand written code to match the returning results of webqq server. However, such code can be easily replaced by one line regular expression match.
example:
get_verify_code can use this regular expression
"ptui_checkVC('([\d])',[ ]?'([\d\A\a!])',[ ]?'([\d\a\A\])'"
and to parse the do_login result, this regular expression can be used
"ptuiCB('([\d])',[ ]?'([\d])',[ ]?'([^'])',[ ]?'([\d])',[ ]?'([^'])',[ ]?'([^'])'[ ]);"