100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > facebook twitter QQ google +1 linkedin disqus gigya 按钮Network (登录)

facebook twitter QQ google +1 linkedin disqus gigya 按钮Network (登录)

时间:2022-11-14 02:47:47

相关推荐

facebook  twitter QQ  google +1  linkedin  disqus gigya 按钮Network (登录)

关联:

widget 工具 widget tools (add this , share this, jia this)

1. Facebook

Text link:

<script>function fbs_click() {u=location.href;t=document.title;window.open('/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><a rel="nofollow" href="/share.php?u=<;url>" οnclick="return fbs_click()" target="_blank">Share on Facebook</a>

Small icon and text:

<script>function fbs_click() {u=location.href;t=document.title;window.open('/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static./images/share/facebook_share_icon.gif?6:26981) no-repeat top left; }</style><a rel="nofollow" href="/share.php?u=<;url>" οnclick="return fbs_click()" target="_blank" class="fb_share_link">Share on Facebook</a>

Icon only:

<script>function fbs_click() {u=location.href;t=document.title;window.open('/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://static./images/share/facebook_share_icon.gif?6:26981) no-repeat top right; } html .fb_share_button:hover { color:#fff; border-color:#295582; background:#3b5998 url(http://static./images/share/facebook_share_icon.gif?6:26981) no-repeat top right; text-decoration:none; } </style> <a rel="nofollow" href="/share.php?u=<;url>" class="fb_share_button" οnclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a>

custom:

<script src="/en_US/all.js#xfbml=1"></script><fb:like href="" layout="button_count" show_faces="true" width="450" action="recommend" font=""></fb:like>

Options:

layout: "standard", "button_count" 和 "box_count";

show_faces: 'true' 和 'false'

action: 'like' 和 'Recommend'

Sources:

/share_partners.php

/docs/guides/web/

custom your facebook button

/facebook-badge.html

登录并获取首页:

<?phpecho 'loading <br/>';$login_email = 'my@sexy.mail';$login_pass = 'my_sexy_password';$fp = fopen("fb_cookies.txt", w);fclose($fp); echo 'still loading <br/>';if (fb_login($login_email,$login_pass)){$ch = curl_init();curl_setopt($ch, CURLOPT_URL, '/login.php?login_attempt=1');curl_setopt($ch, CURLOPT_POSTFIELDS,'charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&locale=en_US&email='.urlencode($login_email).'&pass='.urlencode($login_pass).'&pass_placeholder=&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84');curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_COOKIEJAR, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');curl_setopt($ch, CURLOPT_COOKIEFILE, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/011913 Firefox/3.0.6 (.NET CLR 3.5.30729)");$html = curl_exec($ch);curl_close($ch);echo $html;}function fb_login($login_email, $login_pass){$ch = curl_init();curl_setopt($ch, CURLOPT_URL, '/login.php?login_attempt=1');curl_setopt($ch, CURLOPT_POSTFIELDS,'charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&locale=en_US&email='.urlencode($login_email).'&pass='.urlencode($login_pass).'&pass_placeholder=&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84');curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_COOKIEJAR, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');curl_setopt($ch, CURLOPT_COOKIEFILE, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/011913 Firefox/3.0.6 (.NET CLR 3.5.30729)");$html = curl_exec($ch);$err = 0;$err = curl_errno($ch); curl_close($ch);if ($err != 0){echo 'error='.$err."\n";return(false);} else {echo 'fetching..';return(true);}}?>

2. Twitter

<a href="/share" class="twitter-share-button" data-count="horizontal" data-via="IBTimes" data-related="IBTimes">Tweet</a><script type="text/javascript" src="/widgets.js"></script>

Sources:

/about/retweet_button

/about/resources/tweetbutton

/

3. Stumbleupon

<script src="/hostedbadge.php?s=1"></script>

Sources:

/badges/

4. Google +1

<html><head><title>+1 demo: Basic page</title><script type="text/javascript" src="/js/plusone.js"></script></head><body><g:plusone></g:plusone></body></html>

更多查看:

/webmasters/+1/button/

/apis/+1button/#jsapi

5. Linkedin

<html><head><title>Basic page</title></script></head><body><script src="/in.js" type="text/javascript"></script><script type="IN/Share" data-url="" data-counter="right"></script></body></html>

更多查看:

/docs/DOC-1283

/index.jspa

6. Disqus

<div id="disqus_thread"></div><script type="text/javascript">/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */var disqus_shortname = 'example'; // required: replace example with your forum shortname (you need to register for free)// The following are highly recommended additional parameters. Remove the slashes in front to use.// var disqus_developer = 1;// var disqus_identifier = 'unique_dynamic_id_1234';// var disqus_url = '/permalink-to-page.html';// var disqus_config = function () { this.language = "it"; }; // this will set language to italy for the request, and default is en/* * * DON'T EDIT BELOW THIS LINE * * */(function() {var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;dsq.src = 'http://' + disqus_shortname + './embed.js';(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);})();</script><noscript>Please enable JavaScript to view the <a href="/?ref_noscript">comments powered by Disqus.</a></noscript><a href="" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>

disqus_shortnametells Disqus which website account (called a forum on Disqus) this system belongs to.

disqus_identifiertells Disqus how to uniquely identify the current page.

disqus_urltells Disqus the location of the page for permalinking purposes.

如何出现类似 “We were unable to load Disqus. For more information please see our documentation on identifier and urls.” 的提示错误,可以在JavaScript中加入: var disqus_developer = 1;

更多查看:

/features/

/developers/universal/

7. gigya

<html><head><SCRIPT type="text/javascript" lang="javascript" src="/JS/socialize.js?apikey=2_Y82PzwJ_chSFImHXaIDJClnLyJzmk-VFOavSsaNTzl6m901s_NNxRAS0xJ3bd3_N"></SCRIPT><script>var conf = {APIKey: '2_Y82PzwJ_chSFImHXaIDJClnLyJzmk-VFOavSsaNTzl6m901s_NNxRAS0xJ3bd3_N'};// This method is activated when page is loadedfunction onLoad() {// register for login eventgigya.services.socialize.addEventHandlers(conf, {context: { str: 'congrats on your' }, onLogin: onLoginHandler , onLogout: onLogoutHandler});}// onLogin Event handlerfunction onLoginHandler(eventObj) {alert(eventObj.context.str + ' ' + eventObj.eventName + ' to ' + eventObj.provider + '!\n' + eventObj.provider + ' user ID: ' + eventObj.user.identities[eventObj.provider].providerUID);// verify the signature ...verifyTheSignature(eventObj.UID, eventObj.timestamp, eventObj.signature);// Check whether the user is new by searching if eventObj.UID exists in your databasevar newUser = true; // lets assume the user is newif (newUser) {// 1. Register user // 2. Store new user in DB// 3. link site account to social network identity// 3.1 first construct the linkAccounts parametersvar dateStr = Math.round(new Date().getTime()/1000.0); // Current time in Unix format//(i.e. the number of seconds since Jan. 1st 1970)var siteUID = 'uTtCGqDTEtcZMGL08w'; // siteUID should be taken from the new user record// you have stored in your DB in the previous stepvar yourSig = createSignature(siteUID, dateStr);var params = {siteUID: siteUID, timestamp:dateStr,cid:'',signature:yourSig};// 3.1 call linkAccounts method:gigya.services.socialize.notifyRegistration(conf, params);}document.getElementById('status').style.color = "green";document.getElementById('status').innerHTML = "Status: You are now signed in";}// Note: the actual signature calculation implementation should be on server sidefunction createSignature(UID, timestamp) {encodedUID = encodeURIComponent(UID); // encode the UID parameter before sending it to the server.// On server side use decodeURIComponent() function to decode an encoded UIDreturn '';}// Note: the actual signature calculation implementation should be on server sidefunction verifyTheSignature(UID, timestamp, signature) {encodedUID = encodeURIComponent(UID); // encode the UID parameter before sending it to the server.// On server side use decodeURIComponent() function to decode an encoded UIDalert('Your UID: ' + UID + '\n timestamp: ' + timestamp + '\n signature: ' + signature + '\n Your UID encoded: ' + encodedUID);}// Logout from Gigya platform. This method is activated when "Logout" button is clicked function logoutFromGS() {gigya.services.socialize.logout(conf, {/*no required params*/}); // logout from Gigya platform}// onLogout Event handlerfunction onLogoutHandler(eventObj) {document.getElementById('status').style.color = "red";document.getElementById('status').innerHTML = "Status: You are now signed out";}</script></head><body οnlοad="onLoad()"><br /><h4>Please sign in using one of the following providers:</h4><br /><br /><div id="loginDiv"></div><script type="text/javascript">gigya.services.socialize.showLoginUI(conf, { height: 85,width: 360,showTermsLink:false // remove 'Terms' link,hideGigyaLink:true // remove 'Gigya' link,buttonsStyle: 'fullLogo' // Change the default buttons design to "Full Logos" design,showWhatsThis: true // Pop-up a hint describing the Login Plugin, when the user rolls over the Gigya link.,containerID: 'loginDiv' // The component will embed itself inside the loginDiv Div ,cid:''});</script><br /><br /><br /><br /><h4>Click the button below to sign out from Gigya platform:</h4><br /><br /><input id="btnLogout" type="button" value="Sign Out" οnclick="logoutFromGS()"/><br /><br /><div id="status"></div></body></html>

更多查看:

/

/040_Demos/038_Comments_Plugin

8. QQ

分享到QQ空间

<script type="text/javascript">(function(){var p = {url:location.href,desc:'',/*默认分享理由(可选)*/summary:'',/*摘要(可选)*/title:'',/*分享标题(可选)*/site:'',/*分享来源 如:腾讯网(可选)*/pics:'' /*分享图片的路径(可选)*/};var s = [];for(var i in p){s.push(i + '=' + encodeURIComponent(p[i]||''));}document.write(['<a href="http://sns./cgi-bin/qzshare/cgi_qzshare_onekey?',s.join('&'),'" target="_blank" title="分享到QQ空间"><img src="/ac/qzone_v5/app/app_share/share_s.png" alt="分享到QQ空间" /></a>'].join(''));})();</script>

分享到腾讯朋友

<script type="text/javascript">(function(){var p = {url:location.href,to:'pengyou',desc:'',/*默认分享理由(可选)*/summary:'',/*摘要(可选)*/title:'',/*分享标题(可选)*/site:'',/*分享来源 如:腾讯网(可选)*/pics:'' /*分享图片的路径(可选)*/};var s = [];for(var i in p){s.push(i + '=' + encodeURIComponent(p[i]||''));}document.write(['<a href="http://sns./cgi-bin/qzshare/cgi_qzshare_onekey?',s.join('&'),'" target="_blank" title="分享到腾讯朋友"><img src="/ac/qzone_v5/app/qzshare/to-py.png" alt="分享到腾讯朋友" /></a>'].join(''));})();</script>

分享:/share/

QQ登录:http://connect./

QQ开发平台:/

QQ like:http://like./

9. Reddit

<script type="text/javascript" src="/static/button/button2.js?url=<?=url?>"></script>

/buttons/

本站关联:

widget 工具 widget tools (add this , share this, jia this)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。