function fetch_name() { $crawler = new FacebookCrawler($this->profile, $this->current_cookie); $name_a = $crawler->getTextBetweenTags('<span id="fb-timeline-cover-name">'); $this->response = $this->response . '<b>Name: ' . $name_a[0] . '<b><br>'; $this->slack[0]['title'] = 'Name'; $this->slack[0]['text'] = $name_a[0]; $this->slack[0]['color'] = '#41C6F2'; $friends = $crawler->getTextBetweenTags('<span class="_50f8 _50f4">'); /*if (strpos($friends[0], ' ') !== FALSE) { $f = explode(' ', $friends[0]); $friends[0] = $f[0]; }*/ $friend_count = $crawler->stripLink($friends[0]); $this->response = $this->response . '<b>Friends: ' . $friends[0] . '<b><br>'; $this->slack[1]['text'] = 'Friends: ' . $friend_count; $this->slack[1]['color'] = '#FF002B'; $link = $crawler->extractImage('<img class="profilePic img" '); $this->response = $this->response . '<b>Picture: <br><img src="' . $link . '"><b><br>'; $this->slack[2]['title'] = 'Profile Picture: '; $this->slack[2]['image_url'] = $link; $this->slack[2]['color'] = '#1CE82D'; //$this->slack[2]['mrkdwn_in'] = array('title', 'text'); }