A learning bot in PHP