如何使用php更改facebook状态
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何使用php更改facebook状态相关的知识,希望对你有一定的参考价值。
Changing Facebook Status with php, download the Mini Bot PHP class from the blog http://www.barattalo.it
// // change Facebook status with curl // Thanks to Alste (curl stuff inspired by nexdot.net/blog) public function setFacebookStatus($status, $login_email, $login_pass) { $debug = false; //CURL stuff //This executes the login procedure curl_setopt($ch, CURLOPT_URL, 'https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php'); curl_setopt($ch, CURLOPT_POSTFIELDS, 'email=' . urlencode($login_email) . '&pass=' . urlencode($login_pass) . '&login=' . urlencode("Log in")); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); //make sure you put a popular web browser here (signature for your web browser can be retrieved with 'echo $_SERVER['HTTP_USER_AGENT'];' curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.12) Gecko/2009070611 Firefox/3.0.12"); //This executes the status update //this gets the post_form_id value //we'll also need the exact name of the form processor page curl_setopt($ch, CURLOPT_POSTFIELDS, 'post_form_id=' . $form_id[1] . '&status=' . urlencode($status) . '&update=' . urlencode("Update status")); //set url to form processor page if ($debug) { //show information regarding the request echo "<br><br>Your Facebook status seems to have been updated."; } //close the connection }
以上是关于如何使用php更改facebook状态的主要内容,如果未能解决你的问题,请参考以下文章
使用PageChangeListener动态更改选项卡图标的颜色