搜狐微博WAP第三方一键分享说明文档
2011-09-06 11:03
232 查看
搜狐微博WAP第三方一键分享说明文档
接口说明1,请求URL:
http://w.sohu.com/t2/third/share.do
2,请求类型:
GET
3,请求参数:
url (必须)经过转码的url
title 编码之后的微博内容
appKey 你在开放平台注册的appKey
content 文字编码,当前页面的编码
picture 图片链接地址
returnURL 搜狐微博返回的你的网站url,没有的话,使用url 作为返回
详细解释:
url: 必须。分享页面的url,使用URLEncode UTF-8编码。
title:分享的内容,你可以随意填写内容,使用URLEncode UTF-8编码。
returnURL:搜狐微博返回的你的网站url,没有的话,使用url作为返回。一般不填。
picture:图片链接地址。
content:当你如果不指定title的时候,分享自动读取url页面的title标签内容作为title,并且使用content指定的编码解码title。
什么是appKey?
你可以通过对代码中AppKey进行设置,在你的网页使用一键分享功能并成功转播后,搜狐微博官方网页中你转播的信息将会带上你的网站名称,且可点击打开你的网站。
怎样申请AppKey?
请访问搜狐微博开放平台( http://open.t.sohu.com ),通过创建应用获取AppKey,如需显示来源,请在应用创建完成后,提交审核,我们会根据应用信息进行人工审核,审核通过后应用名称和应用网址将作为分享微博的来源信息。简单的示例代码:
<script type="text/javascript">
function postToWb(){
varmtitle= document.getElementById("title").value;
varmurl= document.getElementById("url").value;
varappkey= document.getElementById("appkey").value;
varpicture= document.getElementById("picture").value;
varreturnURL= document.getElementById("returnURL").value;
var _t = encodeURIComponent(mtitle);
var _url = encodeURIComponent(murl);
var _returnurl= encodeURIComponent(returnURL ); //
var _appkey = encodeURI(appkey); //你从SOHU获得的appkey
var _pic = encodeURI(picture); //(例如:var _pic='图片url1|图片url2|图片url3....)
var _u = 'http://w.sohu.com/t2/third/share.do?url='+_url+'&appKey='+_appkey+'&picture='+_pic+'&title='+_t+'&returnURL='+_returnurl;
window.open( _u);
}
</script>
<title>第三方分享测试</title>
</head>
<body>
<div class="bCon">
<h1>第三方分享测试</h1>
title: <input type="text"id="title" style="width:400px" /><br/><br/>
url: <input type="text" id="url" style="width:400px"/><br/><br/>
appKey: <input type="text" id="appkey" style="width:400px"value="" /><br/><br/>
picture: <input type="text" id="picture" style="width:400px" /><br/><br/>
returnURL: <input type="text" id="returnURL"style="width:400px" /><br/><br/>
<a href="javascript:void(0)"onclick="postToWb();return false;" class="tmblog">
<img src="http://s2.cr.itc.cn/img/t/152.png"alt="分享到搜狐微博WAP" />
分享到搜狐微博WAP
</a>
</div>
</body>
相关文章推荐
- 搜狐微博WAP第三方一键分享说明文档
- android一键分享功能不使用任何第三方sdk
- 第三方一键分享
- 安卓一键分享到qq,微信,微博,官方SDK非第三方
- 微信分享功能JS-SDK说明文档
- 新手上路,一键分享,友盟sdk,不使用第三方sdk(未完待续)
- 安卓一键分享到qq,微信,微博,官方SDK非第三方
- 一键生成表结构说明文档的参考,数据字典生成方式参考
- 分享个人预算系统源码(含说明文档)
- 【Android进阶】使用第三方平台 ShareSDK 实现新浪微博的一键分享功能
- 一键生成表结构说明文档的参考,数据字典生成方式参考
- 【Android进阶】使用第三方平台 ShareSDK 实现新浪微博的一键分享功能
- iOS版Google+更新SDK:支持第三方app内容一键分享至Google+ 支持ID token
- 【Android进阶】使用第三方平台ShareSDK实现新浪微博的一键分享功能
- 一键生成表结构说明文档的参考,数据字典生成方式参考
- 关于微信二次分享,描述变链接的解决方法(一)----文档说明
- Android第三方集成之一键分享ShareSDK的使用eclipse篇
- SharedSDK(三):sharedSdk集成分享及第三方登陆(下载文档Sdk)
- 【第三方SDK】使用ShareSDK实现新浪微博的一键分享功能
- 一键分享到新浪微博、腾讯微博、搜狐微博、人人网、开心网、百度收藏等js代码大全