Download as text
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
/* *author:武明礼 *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>');//引入jQuery document.write('<script type="text/javascript" src="http://i.sso.sina.com.cn/js/sinaSSOManager.js"></scr'+'ipt>');//引入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 "mingli@sina.cn" nick "站在岸上的鱼" sex "1" ssl "0" uid "1627910305" user "mingli.cn" */ } } weibo.prototype.showmsg = function(){ alert(this.unifo); } //话题 function trend(content,count,len){ var count = count || 10; var style = '<style>#trendlist li {font-size:12px;height:25px; line-height:25px;}<\/style>'; document.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>"; document.write(html); } //初始化纯文本微博 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="发布"><br /><br /></div>'; document.write(html); $('#fbbtn').bind("click",function(){ var text = $("#content").val(); send(1,null,encodeURI(text),url); }); } //初始化图片主传类微博 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="30"></textarea><br /><input type="file" id="upfile" name="upfile"> <input type="submit" value="提交"></form>'; document.write(html); } //发布微博 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('未登录,请先登录'); }else if(data=='-2'){ alert('您还没有开通微博!'); }else if(data.error_code=='20019'){ alert('内容重复,不要太贪心哦~'); }else if(data.error_code=='10016'){ alert('内容为空,禁止发布!'); }else if(data.mid>0){ alert('发布成功'); }else{ alert('发布失败:Error info:'+data.error); } }); } //转发 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); }); } //评论 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); }); } //关注 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("已关注"); } }); } |
博客内容仅提及可下载为文本,但未提供更多关键信息。
686

被折叠的 条评论
为什么被折叠?



