public function updateBio($member) { $url = $this->_profileUrlBase . $member->bioguide_id; if ($this->browser->get($url)->responseIsError()) { //Error response (eg. 404, 500, etc) throw new Exception("Couldn't get " . $url); } $this->_bioPageText = $text = LsString::newlinesToSpaces($this->browser->getResponseText()); //get bio if (preg_match('/, <\\/FONT>([^<]+)<\\/(TD|P)>/', $text, $bio)) { $bio = preg_replace('/\\n/', ' ', $bio[1]); $bio = ucfirst(trim(preg_replace('/\\s{2,}/', ' ', $bio))); $bio = LsHtml::replaceEntities($bio); $member->summary = $bio; $this->printDebug("Bio: " . $bio); if (preg_match('/\\b(a(\\s+\\p{L}+){2,8})\\;/isu', $bio, $match)) { $blurb = 'US ' . preg_replace('/a\\s+/isu', '', $match[1]); $member->blurb = $blurb; $this->printDebug("Blurb: " . $blurb); } } else { $this->printDebug("Couldn't find member bio on " . $url); } }