jquery Ajax Call Sina microblogging content method

Source: Internet
Author: User

Now the popular thing microblogging is the Internet play more fire things, today we have to use Sina app to achieve the designated micro-blog account of the microblogging content recording method. Hope to help you.

<title> Sina Weibo app development application sample capture Weibo content records for designated Weibo accounts </title>
<script type= "text/web Effects" 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>
<body>
Weibo id:<input type= "text" id= "id"/><br/>
Number of tweets (up to 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 is 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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.