<? Php $ Cookie_file = dirname (_ FILE _). "/renren. cookie "; $ Login_url = 'http: // passport.renren.com/plogin.do '; $ Post_fields ['email '] = ''; // your account $ Post_fields ['password'] = ''; // password for everyone $ Post_fields ['url url'] = 'http % 3A % 2F % 2Fhome.renren.com % 2FHome. do '; $ Post_fields ['domain '] = 'renren. Com '; $ Ch = curl_init ($ login_url ); Curl_setopt ($ ch, CURLOPT_USERAGENT, 'mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv: 1.9.1.5) Gecko/20091102 Firefox/3.5.5 '); Curl_setopt ($ ch, CURLOPT_HEADER, 0 ); Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 ); Curl_setopt ($ ch, CURLOPT_MAXREDIRS, 1 ); Curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1 ); Curl_setopt ($ ch, CURLOPT_AUTOREFERER, 1 ); Curl_setopt ($ ch, CURLOPT_POST, 1 ); Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ post_fields ); Curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ cookie_file ); $ Content = curl_exec ($ ch ); Curl_close ($ ch ); // Match the user ID $ Send_url = 'http: // www.renren.com/home '; $ Ch = curl_init ($ send_url ); Curl_setopt ($ ch, CURLOPT_HEADER, 0 ); Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 ); Curl_setopt ($ ch, CURLOPT_COOKIEFILE, $ cookie_file ); Curl_exec ($ ch ); $ Info = curl_getinfo ($ ch ); Curl_close ($ ch ); // Obtain the user ID $ Tmp = explode ('/', $ info ['redirect _ url']); $ Uid = array_pop ($ tmp ); Unset ($ tmp ); // $ Uid = "305115027 "; // Obtain the token and mnsx. $ Send_url = 'http: // www.renren.com/'.w.uid; $ Ch = curl_init ($ send_url ); Curl_setopt ($ ch, CURLOPT_HEADER, 0 ); Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 ); Curl_setopt ($ ch, CURLOPT_COOKIEFILE, $ cookie_file ); $ Tmp = curl_exec ($ ch ); Curl_close ($ ch ); Preg_match_all ("/get_check :'(.*?) ', Get_check_x :'(.*?) ',/Is ", $ tmp, $ arr ); $ Token = $ arr [1] [0]; // 1121558104 $ Scn = $ arr [2] [0]; // e9a9cb2 // Publish information $ Poststr ['content'] = "this is just a test !!! "; $ Poststr ['withinfo'] = '{"wpath": []}'; $ Poststr ['hostid: '] = $ uid; $ Poststr ['privacyparams'] = '{"sourceControl": 99 }'; $ Poststr ['requesttoken'] = $ token; $ Poststr ['_ mns'] = $ mns; $ Poststr ['channel'] = "renren "; $ Head = array ( 'Referer: http://shell.renren.com/ajaxproxy.htm ', 'X-Requested-With: XMLHttpRequest ', ); $ Ch = curl_init ("http://shell.renren.com/?#uid=/status "); Curl_setopt ($ ch, CURLOPT_USERAGENT, 'mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv: 1.9.1.5) Gecko/20091102 Firefox/3.5.5 '); Curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ head ); Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 ); Curl_setopt ($ ch, CURLOPT_MAXREDIRS, 1 ); Curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1 ); Curl_setopt ($ ch, CURLOPT_AUTOREFERER, 1 ); Curl_setopt ($ ch, CURLOPT_POST, 1 ); Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ poststr ); Curl_setopt ($ ch, CURLOPT_COOKIEFILE, $ cookie_file ); $ Content = curl_exec ($ ch ); Curl_close ($ ch ); $ Data = json_decode ($ content, true ); If ($ data ["code"] = "0 "){ Echo "released successfully! "; } Else { Echo "shit !!! "; } |