微信、微博、Facebook、Twitter等社交媒体分享方案探索

来源:互联网 发布:双肩背包 知乎 编辑:程序博客网 时间:2024/06/06 17:18
 

微信、微博、Facebook、Twitter等社交媒体分享方案探索

标签: share分享android微信facebook
 911人阅读 评论(0) 收藏 举报
 分类:

目录(?)[+]

一、Web方式:

新浪微博:

http://service.weibo.com/share/share.php?

count=表示是否显示当前页面被分享数量(1显示)(可选,允许为空)

&url=将页面地址转成短域名,并显示在内容文字后面。(可选,允许为空)

&appkey=用于发布微博的来源显示,为空则分享的内容来源会显示来自互联网。(可选,需要注册新浪开发appkey)

&title=分享时所示的文字内容,为空则自动抓取分享页面的title值(可选,允许为空)

&pic=自定义图片地址(可选,允许为空,多个地址用||分隔)

&ralateUid=转发时会@相关的微博账号(可选,允许为空)

&language=语言设置(zh_cn|zh_tw)(可选)

QQ空间:(http://connect.qq.com/intro/share/)

http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?

url=分享的网址

&desc=默认分享理由(可选)

&summary=分享摘要(可选)

&title=分享标题(可选)

&site=分享来源 如:腾讯网(可选)

&pics=分享图片的路径(可选)

QQ分享给朋友:(http://connect.qq.com/intro/share/)

http://connect.qq.com/widget/shareqq/index.html?

url=取URL,可加上来自分享到QQ标识,方便统计

&desc=分享理由(风格应模拟用户对话),支持多分享语随机展现(使用|分隔)

&title=分享标题(可选)

&summary=分享摘要(可选)

&pics=分享图片(可选)

&flash=视频地址(可选)

&site=分享来源(可选) 如:QQ分享

Facebook:(http://ogp.me/)

https://www.facebook.com/sharer/sharer.php?

u:分享的url

Twitter:(https://dev.twitter.com/web/tweet-button/web-intent)

https://twitter.com/intent/tweet?

url : 分享的URL

text : 描述内容

hashtags: 用逗号分隔的标签集

related:@用户

via:关联账户

Google+:

https://plus.google.com/share?

url : 分享的URL


二、Intent方式:

 

分享图片+文字

分享文字

Facebook

仅图片成功

不成功

Twitter

OK

OK

Google+

OK

OK

Weibo

OK

OK

Webchat朋友圈

图片显示缩略图,文字失败

不支持

Webchat朋友

未显示缩略图,文字分享后不可见

OK

QQ空间

OK

OK

QQ分享给朋友

仅图片成功

OK


初步结论:

  1. Webchat只能通过嵌入sdk方式实现(只使用分享到朋友圈混淆压缩后size增加12k)

  2. Google+、Twitter、Weibo、Qzone安装了app时可通过intent方式实现,未安装app时可通过web share url方式实现。

  3. Facebook需要通过web share url实现

  4. Facebook、Twitter、Google+ web share url方式需要网页插入特定meta tag才能实现自动抓取内容显示缩略效果

  5. 具体实现请参照master base下ShareHelper

TODO:

  1. Google+ intent分享时因为存在多个可处理intent的component需要制定component class

  2. Facebook、WebChat以及Weibo web share url方式需要申请开发者账号

          Facebook:https://developers.facebook.com/

          Webchat:https://open.weixin.qq.com/

          Weibo:http://open.weibo.com/

     3.Web Social Graph Meta Tags:参照http://t.cn/RZ1khUw (内含网址检验工具)

<!-- common tag  (google+)-->

<metaproperty="og:title"content="Google+ title"/>

<metaproperty="og:url"content="http://www.uc.cn"/>

<metaproperty="og:image"content="http://www.android.com/tile-1.jpg"/>

<metaproperty="og:description"content="www.android.com..."/>

<metaproperty="og:site_name"content="IMDb"/>

Google+Url Debugger:

http://www.google.com.hk/webmasters/tools/richsnippets?gws_rd=cr

<!-- Facebook -->

<metaproperty="fb:admins"content="579622216,709634581">

<metaproperty="fb:app_id"content="1389892087910588">         需要注册开发APP id

<metaproperty="article:author"content="http://www.uc.cn">

<metaproperty="article:publisher"content="http://www.uc.cn">

          FB Url Debugger :https://developers.facebook.com/tools/debug/og/object/

<!-- Twitter -->

<metaname="twitter:card"content="summary"/>

<metaname="twitter:site"content="@nytimesbits"/>

<metaname="twitter:creator"content="@nickbilton"/>

TwitterUrl Debugger:https://cards-dev.twitter.com/validator


4.网页不含标准tag时,FB等会尝试自动查找页面部分属性标签如title、description、img等自行完成填充

0 0