function update_status($status) {
$data = $this->curl_scrape ( "http://www.facebook.com/home.php?_fb_noscript=1" );
if (totalStr ( strtolower ( $data ), "on your mind" ) !== 0) {
preg_match ( "/name=\"fb_dtsg\" value=\"(.*?)\"/", $data, $fields ["fb_dtsg"] );
preg_match ( "/name=\"profile_id\" value=\"(.*?)\"/", $data, $fields ["profile_id"] );
preg_match ( "/name=\"composer_id\" value=\"(.*?)\"/", $data, $fields ["composer_id"] );
preg_match ( "/name=\"target_id\" value=\"(.*?)\"/", $data, $fields ["target_id"] );
preg_match ( "/name=\"post_form_id\" value=\"(.*?)\"/", $data, $fields ["post_form_id"] );
$url = "http://www.facebook.com/ajax/updatestatus.php?__a=1";
$string = "charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&fb_dtsg=" . $fields ['fb_dtsg'] [1] . "&composer_id=" . $fields ['composer_id'] [1] . "&profile_id=" . $fields ['profile_id'] [1] . "&target_id=0&display_context=home&status=" . urlencode ( $status ) . "&=Share&nctr[_mod]=pagelet_composer&post_form_id=" . $fields ['post_form_id'] [1] . "&post_form_id_source=AsyncRequest";
$data = $this->curl_post ( $url, $string );
if (totalStr ( $data, "error\":0" ) !== 0) {
return array (true, $data, $string );
} else {
return array (false, $data, $string );
}
} else {
return array (false, "No write access", $string );
}
}