Crane
Table_bottom

Search
Loading
Table_bottom

分类
Table_bottom

随机文章
Table_bottom

标签云
Table_bottom

最新评论
Table_bottom

链接
Table_bottom

功能
Table_bottom

给google reader增加分享到人人网功能

Crane posted @ 2010年7月31日 01:23 in Computer with tags google reader , 6183 阅读

现在每天几乎都要看一下人人网和google reader,SNS用来娱乐,和朋友沟通,GReader用来阅读,获取信息和知识,于是想把GR上看到的好文章分享到人人网上去和大家一直共享。

要实现这样的功能其实有现成的东西,人人网早提供了站外分享的工具,给自己网站加此功能的话可以修改代码(看这里),加上人人的分享代码的链接,给浏览器添加的话人人也做好了相关的分享书签,firefox的话还有小扩展可以用(看这里)。

这样的方法的话还是有个问题,在GR中阅读的时候看到的是google抓RSS得来的东西,我们真正要的东西是在frame里面的,直接用当前网址只是GR的阅读页面,要分享的话我们还是转去原始页面一次,才能使用上面说到的方法,不过我们既然都已经看到内容了还转过去一次再分享略显麻烦,所以我们要在GR的设置里面想办法,因为google一般都提供了很多的自定义功能,而且设置好的话是保存在自己的账号设置里面的,哪里都可以用,不像上面的方法是保存在浏览器上的。

 

打开google的setting,选择位于最右边的Send To标签,点下面的create a custom link

Google Reader Sent To setting

URL:http://share.renren.com/share/buttonshare.do?link=${short-url}

Icon URL:http://a.xnimg.cn/imgpro/share/share-tinybtn.png

这样填写,save就OK了,以后看到想要分享的文章时,直接点Send To->分享到人人网就行了。

其实这个方法原理很简单,看人人提供的站外分享的代码(这里):

<a href="javascript:void((function(s,d,e){if(/renren\.com/.test(d.location))return;var f='http://share.renren.com/share/buttonshare?link=',u=d.location,l=d.title,p=[e(u),'&title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));" title="分享到人人"><img src="http://a.xnimg.cn/imgpro/share/share-tinybtn.png" title="分享到人人"/></a>

稍微看一下这里的代码就知道人人的分享链接格式是这样的:http://share.renren.com/share/buttonshare?link=后面接上要分享的页面的地址,于是上面的就很好理解了,上面的URL刚好就是这样的格式组合出来的,下面的那个icon是图标,从上面这个人人网的分享代码里拉出来的。

可以举一反三,什么分享到开心,豆瓣之类的,还有微博等等,都是一样的原理,只需要看一下他们的分享代码,把上面的前缀部分改掉就可以了,详细参见这里:http://www.douban.com/note/41808100/

Assam HSLC Science M 说:
2022年9月27日 05:46

General Science is one of the most important subjects to the Assam State SEBA board Government and Private school class 10th Grade. Assam HSLC Science Model Paper General Science is one of the most important subjects to the Assam State SEBA board Government and Private school class 10th Grade.Those students can download SEBA HSLC Science Study Material 2023 Pdf with an important question bank along suggested question bank for all science examination tests conducted by Secondary Education Board Assam.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter