Introduction: This is a detailed page for Sina Weibo app development and application examples to obtain Weibo content records for a specified Weibo account. It introduces PHP-related knowledge, skills, and experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 339498 'scrolling = 'no'> recently, I am developing an app for Sina Weibo. In this example, I will obtain the Weibo content record of a specified Weibo account.
Hefei network product Center
Example of app development on Sina Weibo
<HTML>
<Head>
<Title> Sina Weibo app development application example: Getting Weibo content records of a specified Weibo account </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>
Weibo ID: <input type = "text" id = "ID"/> <br/>
Number of Weibo posts extracted (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: '20140901 ',
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 ()
// Appkey at source
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>
ArticleSource: Hefei network product Center
This article: http://lab.wehefei.com/posts/285
For more information, visit.
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/339498.html pageno: 8.