Skip to content

Instantly share code, notes, and snippets.

@silviopaganini
Created January 9, 2013 12:39
Show Gist options
  • Save silviopaganini/4492845 to your computer and use it in GitHub Desktop.
Save silviopaganini/4492845 to your computer and use it in GitHub Desktop.
Share Buttons for the Chinese Market (RenRen and Weibo)
addRenRen : =>
p = []
w = 130
h = 20
lk = {url:'' || window.location.href, title:'' || document.title, description:'', image:''}
p.push(k + "=" + encodeURIComponent(v || '')) for k, v of lk
@renren = $("<iframe scrolling=\"no\" frameborder=\"0\" allowtransparency=\"true\" src=\"http://www.connect.renren.com/like/v2?#{p.join("&")}\" style='width:#{w}px; height:#{h}px;'/>")
@$el.append @renren
addWeibo : =>
_w = 72
_h = 24
params = {
url : window.location.href
type : '2'
count : '1'
appkey : ''
title : ''
pic : ''
ralateUid : ''
language : 'zh_cn'
rnd : new Date().valueOf()
}
temp = []
temp.push(k + '=' + encodeURIComponent( v || '' ) ) for k, v of params
@weibo = $('<iframe class="weibo_share" allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"/>')
@weibo.css
"-webkit-transform" : "scale(.85)"
"margin-top": "-2px"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment