Well, the response (one of them

) is a template variable. Check the already included sample, the TV called "loginName".
It’s a text input TV, with the default value of:
@EVAL if ($modx->getLoginUserID()) return 'Logout'; else return 'Login';
From this you can work out your code and save it as another TV, let’s say
nameOfTV.
You can use any php function/code/modx functionality to get the info you want.
Later, your page title would be
[*nameOfTV*] and the title would change dinamically.
MODx 0.9.5 has a bug and the EVAL code in the TV must all be in one line!
If you need more code rather use a snippet call in the TV. See
http://modxcms.com/forums/index.php/topic,11315.0.html