From: http://www.taoba123.com/show.asp? Id = 7392
Recently, domestic and foreign microblogs have become popular, and most people are writing Weibo together. However, as Weibo becomes popular, people gradually get used to sending messages about life, work, study, and entertainment to their microblogs, for this reason, I have sorted out mainstream Weibo shares.CodeFor your use.
I. Sina Weibo sharing code:
1. Common Code for various websites, forums, and blogs:
This Code does not need to apply for appkey
2. Sina shares the Code:
Note:
You need to apply for an appkey account at: open.t.sina.com.cn
Required parameter for real appkey {string}
Optional parameter of image Link (string), empty by default
The title (string) is optional. The default is the title of the current page.
Content Link (string) is an optional parameter, which defaults to the location of the current page.
Optional parameter for page encoding (string). [gb2312 | UTF-8] default value: gb2312
<A> you can modify the link style and text as needed. "% 20f" is a normal code in the Code, which does not need to be processed.
3. Unofficial official code:
| 1), <a href = "http://v.t.sina.com.cn/share/share.php? Title = % E4 % BD % A0 % E5 % a5 % BD % 20 Hello % 20 World "target =" _ blank "> share on Weibo </a>, simple sharing (no application required)
2), <a href = "http://v.t.sina.com.cn/share/share.php? Appkey = 4120396272 & Title = % E4 % BD % A0 % E5 % a5 % BD % 20 Hello % 20 World "target =" _ blank "> share on Weibo </a>, with appkey (appkey needs to go to open.t.sina.com.cn to apply)
The field must go through encodeuricomponent, for example:
Hello http://t.sina.com.cn/-& gt <SCRIPT> document. Write (encodeuricomponent ("Hello http://t.sina.com.cn/"); </SCRIPT> |
Note: You need to apply for the appkey at open.t.sina.com.cn.
Ii. NetEase Weibo sharing code
1. Style 1: Any website or blog can be called.
| <A href = "javascript :( function () {window. Open ('HTTP: // t.163.com/article/user/checklogin.do? Link = http://news.163.com/&source='potato net' + '& info =' + encodeuricomponent (document. title) + ''+ encodeuricomponent (location. href), '_ blank', 'width = 510, Height = 300 ');})() "Title =" share To Netease Weibo "> </a> |
2. Style 2
| <A target = "_ Self" onclick = "(function () {var url = 'link = http://news.163.com/&source='+ encodeuricomponent ('netease News') + '& amp; info = '+ encodeuricomponent (document. title) + ''+ encodeuricomponent (document. location. href); window. open ('HTTP: // t.163.com/article/user/checklogin.do? '+ URL +' & amp; '+ new date (). gettime (), 'newwindow', 'height = 330, width = 550, Top = '+ (screen. height-280)/2 + ', Left =' + (screen. width-550)/2 + ', toolbar = No, menubar = No, scrollbars = No, resizable = Yes, location = No, status = no ');})() "href =" javascript: void (0 ); "> share on Netease Weibo </a> |
The above code is simple and practical. It is a secret weapon for you to give your own blogs and websites a home, and I wish you a pleasant stay. = ^ _ ^ = (Text/monkey)