<?php session_start(); include_once 'config.php'; include_once 'saet.ex.class.php'; header('Content-Type:text/html; charset=utf-8'); $c = new SaeTClient(WB_AKEY, WB_SKEY, $_SESSION['last_key']['oauth_token'], $_SESSION['last_key']['oauth_token_secret']); if (isset($_REQUEST['repost'])) { $c->repost($_REQUEST['sid'], $_REQUEST['repost'], 1); echo "<p>转发回复完成</p>"; } ?> <a href="http://pengpeng.sinaapp.com/weibolist.php" target="_blank">返回</a>
//應用的AppSecret $token = ''; //用戶的AccessToken $tsec = ''; //用戶的AccessSecret //上面的全部要字符串 $so = new SaeTClient($akey, $asec, $token, $tsec); if ($_POST[mid] != NULL && strlen($_POST[mid]) > 0) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://api.t.sina.com.cn/queryid.json?mid=' . $_POST[mid] . '&isBase62=1&type=1'); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $rs = curl_exec($curl); curl_close($curl); $id = json_decode($rs)->id; $return = $so->repost($id, $_POST[Text1], 0); } else { $return = $so->update(str_replace('\\r', '', str_replace('\\n', ' ', $_POST[Text1])), NULL, NULL, NULL, NULL); } if ($return['error'] != NULL) { echo '发布失败。<br />' . $return['error']; } else { echo '发布成功。'; } ?> </head> <html> <body> <br> <a href="http://weibo.com/6zsd">跳入六中树洞</a>(若使用手机请直接用新浪客户端)<br> <a href="javascript:void(0);" onclick="history.back()">后退</a>