zoukankan      html  css  js  c++  java
  • 新浪微博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

    更多,欢迎来访问。


  • 相关阅读:
    Python 模块 itertools
    Python 字符串的encode与decode
    python 模块 hashlib(提供多个不同的加密算法)
    暴力尝试安卓gesture.key
    hdu 1300 Pearls(DP)
    hdu 1232 畅通工程(并查集)
    hdu 1856 More is better(并查集)
    hdu 1198 Farm Irrigation(并查集)
    hdu 3635 Dragon Balls(并查集)
    hdu 3038 How Many Answers Are Wrong(并查集)
  • 原文地址:https://www.cnblogs.com/jincon/p/2090649.html
Copyright © 2011-2022 走看看