-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweibolist.php
65 lines (52 loc) · 1.79 KB
/
weibolist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
include_once( 'http.class.php' );
include_once( 'config.php' );
$url = "http://t.house.sina.com.cn/mblog/api/mblog/public_timeline.php";
$data = array("target"=>TARGET, "akey"=>WB_AKEY , "skey"=>WB_SKEY, "access_token"=>$_SESSION['last_key']['access_token'] , "access_secret"=>$_SESSION['last_key']['access_secret']);
$c = json_decode(cls_http::init()->post($url,$data),true);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>
<body>
<h2><?=$me['name']?> 你好~ 要换头像么?</h2>
<form action="weibolist.php" >
<input type="text" name="avatar" style="width:300px" value="头像url" />
<input type="submit" />
</form>
<h2>发送新微博</h2>
<form action="weibolist.php" >
<input type="text" name="text" style="width:300px" />
<input type="submit" />
</form>
<h2>发送图片微博</h2>
<form action="weibolist.php" >
<input type="text" name="text" style="width:300px" value="文字内容" />
<input type="text" name="pic" style="width:300px" value="图片url" />
<input type="submit" />
</form>
</body>
</html>
<?php
if( isset($_REQUEST['text']) || isset($_REQUEST['avatar']) )
{
if( isset($_REQUEST['pic']) )
$rr = $c ->upload( $_REQUEST['text'] , $_REQUEST['pic'] );
elseif( isset($_REQUEST['avatar'] ) )
$rr = $c->update_avatar( $_REQUEST['avatar'] );
else
$rr = $c->update( $_REQUEST['text'] );
echo "<p>发送完成</p>" ;
}
?>
<?php if( is_array( $ms ) ): ?>
<?php var_export($ms); foreach( $ms as $item ): ?>
<div style="padding:10px;margin:5px;border:1px solid #ccc">
<?=$item['text'];?>
</div>
<?php endforeach; ?>
<?php endif; ?>