Test Weibo API Reference page <! doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "HTTP// Www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Test Micro bo Api/**author: Wu Mingli *for:test*developed at :2011.8.29*copyright 2011. all rights reserved.*/ document.write (' <script type= ' Text/javascript " src=" Jquery-1.6.1.min.js " ><\/scr ' + ' ipt> ');//introduced Jquerydocument.write (' <script type= "Text/javascript" src= "/HTTP/ I.sso.sina.com.cn/js/sinassomanager.js "></scr ' + ' ipt> ');//introduced sso//document.location.host = ' Sina.com.cn '; Function weibo () {};weibo.prototype = {init:function (action,type,style) {switch (type ) {case "text": Var zturl = style.zturl;inittext (Zturl);break;case "img": InitImgWeibo () ;break;case "trend": Var con = style.topic;var ct = style.count;var len = style.length;trend (Con,ct,len); Break;}},uinfo:function () {Return sinassomanager.getsinacookie ();/*return data:ag "8" DOB "1982-09-01" email "[email protected]" nick "standing Ashore Fish" sex "1" SSL "0" UID "1627910305" User "mingli.cn" */}}wEibo.prototype.showmsg = function () {alert (THIS.UNIFO);} //topic Function trend (content,count,len) {var count = count | | 10;var style = ' <style> #trendlist li {font-size:12px;height:25px; line-height:25px;} <\/style> ';d ocument.write (style);var html = ' <ul id= "trendlist" style= " font-size:12px; " > ';var url = ' http://supports.jiaju.sina.com.cn/api/weibo.php?action=trend&trend= "+ content+ "&page=1&count=" +count+ "&callback=?"; $.getjson (url,function (data) {var dt = data.statuses;for (var i=0; i < dt.length;i++ ) {document.write (' <li style= "height:25px; line-height:25px;font-size : 12px; " > ' +dt[i].text.substr (0,len) + ' </li> ');} });html += "</ul>";d ocument.write (HTML);} //Initialize Plain text weibo function inittext (URL) {var html = '<div id= "Textweibo" ><textarea name= "content" id= "Content" rows= "5" cols= "30" ></textarea><br /><input type= "Submit" id= "Fbbtn" value= "release" ><br /><br /></div> ';d ocument.write (HTML); $ (' #fbbtn '). Bind ("click", Function () {var text = $ ("#content"). Val (); Send (1,null,encodeuri (text), URL);});} Initialize Image Master Biography Function initimgweibo () {var html = ' <form name= "form" method= " Post " enctype=" Multipart/form-data " action=" http://supports.jiaju.sina.com.cn/api/weibo.php?action= Send&file_tag_name=upfile&type=3 "><textarea name=" content " id=" Content " rows=" 5 " cols= "></textarea><br /><input type=" "File" id= "Upfile" name= " Upfile "> <input type=" Submit " value=" Submission "></form>";d ocument.write (HTML);} //released Weibo function send (type,pic,content,url) {Var linK= '; if (type == 1 && pic == null) {link= "http:/ Supports.jiaju.sina.com.cn/api/weibo.php?action=send&type= "+type+" &content= "+content+" "+url+" &callback=? ";} Else if (type == 2 && pic!= ") {link=" http://supports.jiaju.sina.com.cn/api/ Weibo.php?action=send&type= "+type+" &content= "+content+" "+url+" &url= "+pic+" &callback=? ";} $.getjson (link, function (data) {if (data== '-1 ') { alert (' Not logged in, please login first '); }else if (data== '-2 ') { alert (' You have not yet launched the Weibo! }else if (data.error_code== ' 20019 ') { alert (' Repeat the content, don't be greedy oh ~ '); }else if ( data.error_code== ' 10016 ') { alert (' content is empty, prohibit publishing! }else if (data.mid>0) { alert (' Publish succeeded '); }else{alert (' Publish failed: Error info: ' +data.error); } }); Forward Function transmit () {Var content=$ ("#content"). Val (); var url = "Http://supports.jiaju.sina.com.cn/api/weibo.php?action=transmit &content= "+content+" &wid=3362282635551012&callback=? "; $.getjson (url, function (data) {alert (data.id); }); Comment Function comment () {var content=$ ("#content"). Val (); var url = "http:// Supports.jiaju.sina.com.cn/api/weibo.php?action=comment&content= "+content+" &wid=3362282635551012& Callback=? "; $.getjson (url, function (data) {alert (data.id); }); Follow Function follow (UID) {var url = "http://supports.jiaju.sina.com.cn/api/weibo.php?action= Followme&uid= "+uid+" &callback=? "; $.getjson (url, function (data) {if (data.id | | data.error_code == 20506) {alert ("already concerned");} });}Original address: Http://mingli-sina-cn.iteye.com/code
Weibo API Vulnerability