我正在考虑开发一个创建 Pinterest pinit 按钮的插件。我找不到 Pinterest 按钮的 API。谁能告诉如何找到 pinit 按钮代码?pinterest 是否公开提供 API?
问问题
212 次
2 回答
0
试试这个代码
<a href="http://pinterest.com/pin/create/button/?url=YOUR_PAGE_URl&media=IMAGE_URL&description=Spinach Artichoke Meatballs on MyRecipeMagic.com" count-layout="none" target="_blank" onclick="rewards('pin_it')" class="pin-it-button"><img border="0" title="Pin It" src="http://assets.pinterest.com/images/PinExt.png"></a>
于 2013-04-24T08:16:55.557 回答
0
我最好的解决方案,我将代码与其他社交分享
<div class="si-share noborder clearfix">
<div>
<a href="http://www.facebook.com/sharer.php?u=$AbsoluteLink" class="social-icon si-borderless si-facebook" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
<i class="icon-facebook"></i>
<i class="icon-facebook"></i>
</a>
<a href="https://twitter.com/share" class="social-icon si-borderless si-twitter" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
<i class="icon-twitter"></i>
<i class="icon-twitter"></i>
</a>
<a href="javascript:void(0)" id="pinit" class="social-icon si-borderless si-pinterest" >
<i class="icon-pinterest"></i>
<i class="icon-pinterest"></i>
</a>
<a href="https://plus.google.com/share?url=$AbsoluteLink" class="social-icon si-borderless si-gplus" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=500');return false;">
<i class="icon-gplus"></i>
<i class="icon-gplus"></i>
</a>
</div>
<span style="float: right">Share :</span>
和相关的javascript
<script type="text/javascript" >
$(document).ready(function(){
$("#pinit").click(function(){
$("#pinmarklet").remove();
var e = document.createElement('script');
e.setAttribute('type','text/javascript');
e.setAttribute('charset','UTF-8');
e.setAttribute('id','pinmarklet');
e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e);
});
});
于 2015-10-29T11:15:05.693 回答