新浪微博APP开发应用示例之获取指定微博账户的微博内容记录

最近在搞下新浪微博APP开发应用,这个示例之获取指定微博账户的微博内容记录

合肥网产品中心

 


< html >
< head >
< title > 新浪微博APP开发应用示例之获取指定微博账户的微博内容记录 </ title >
< script  type ="text/javascript"  src ="http://js.wcdn.cn/t3/platform/js/api/wb.js"  charset ="utf-8"   ></ script >
< script  type ="text/javascript"  src ="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" ></ script >
</ head >
< body >
微博ID:
< input  type ="text"  id ="id" />< br />
提取微博的数量(最多20条):
< input  type ="text"  id ="num" />< br />
< input  type ="button"  onclick ="testt($('#id').val(),$('#num').val());"  value ="button" />
</ body >
< script  type ="text/javascript" >
WB.core.load([
' connect ' ' client ' ],  function () {
    
var  cfg  =  {
        key: 
' 3274830762 ' ,
        xdpath: 
' sina.html '
    };
    WB.connect.init(cfg);
    WB.client.init(cfg);
});
function  testt(id,num){
 $.ajax({
                url: 
" http://api.t.sina.com.cn/statuses/user_timeline.json " ,
                data: 
" source=941123049&user_id= "   +  id,  // "method=read", //$("#textBox1").children().serialize()
//
source 处是appkey
                dataType:  " jason " ,
                type: 
" POST " ,
                success: 
function (data) {
                        
// alert(data.length);
                         var  t  =  eval( ' ( '   + data +   ' ) ' );
                        
// alert(data);
                         // alert(t.length);
                         if  (num > 20 )
                        {
                                num
= 20 ;
                        }
                        
for  (i = 0 ;i < num ;i ++  )
                        {
                                $(
" body " ).append( " <br/> "   +   " [ "   +  i  +   " ] "   +  t[i].text  +   " <br/> " );
                        }
                  }
           } );

   }

</ script >
</ html >
  

文章来源:合肥网产品中心  

本文:http://lab.wehefei.com/posts/285

更多,欢迎来访问。


转载于:https://www.cnblogs.com/jincon/archive/2011/06/26/2090649.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值