La idea es aislar el dato de la cantidad de followers o fans para no tener que utilizar los gadgets oficiales de estos servicios y poder utilizar dónde lo necesitemos, sólo esa parte de la información.
Estas cifras las extraeremos con JSON leyendo los datos con jQuery, por lo que se hace imprescindible esta última librería. En la primera línea de este código está la llamada a las librerías de Google que la carga. Si ya estáis usando jQuery esa línea es innecesaria.
Como lo normal será incluir esto como gadget, el código está preparado para añadirlo a uno tipo HTML/JavaScript:
/script
script type="text/javascript"
var f_page = 'oloblogger';
var t_page = 'oloman';
$(document).ready(function(){
$.getJSON('https://graph.facebook.com/'+f_page+'?callback=?', function(data) {
var fb_count = data['likes'];
$('#fb_count').html(fb_count);
});
$.getJSON('http://api.twitter.com/1/users/show.json?screen_name='+t_page+'&callback=?', function(data) {
twit_count = data['followers_count'];
$('#twitter_count').html(twit_count);
});
});
/script
Hay un par de variables para personalizar los resultados con los sitios de cada cual. La primera es el nombre de vuestra página facebook, la última palabra de la dirección (http://www.facebook.com/oloblogger). La segunda es vuestro usuario Twitter sin el símbolo @ o también la última palabra de vuestro perfil en este servicio (http://www.twitter.com/oloman).
Para mostrar los datos ya sólo resta crear dos capas con las correspondientesID a continuación del script. Una serátwitter_count y la otrafb_count. Así:
span id="fb_count"/span
Pero esto de aquí arriba es lo único que obtendremos, dos tristes y solitarios números, por lo que para solucionar del todo el asunto, ya tenemos que recurrir a CSS y sobre todo a la imaginación de cada uno.
La siguiente sería sólo una idea a modo de ejemplo de entre la infinidad de posibilidades:
width: 120px;
margin: 0px auto;
text-align: center;
padding: 10px;
font-size: 18px;
background-color: #CCC;
border-radius: 10px;
box-shadow: 0 0 30px black;
}
.twitterimg {
display: inline-block;
vertical-align: middle;
width: 32px;
height: 28px;
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYuoKXN_2ruUbfZepu9knkH1bj-Fx1y4R19e4Llu8bO6k3uxZcB4ZGPKZKAz6LM4lBqMWuF5PNwppufJg138-Xv2pxMboqrTx2T5_pApBTwmdJ1e3WJ9bUhfz9V236a_iQ9YmwJfG6JNM/s32/twitter-follow-32.png) -4px -4px;
}
.facebookimg {
display: inline-block;
vertical-align: middle;
width:32px;
height:32px;
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFaROQ0hmvtHuVCflIkcwLYI27gI3ctjfKwfz2pkkvDiGLp1tFn4XSulqbMWxqkDhyphenhyphenyKLyy45c4Kh265ruf-3BzOR3_rU7sP8XK6agqn1F4RHOAs25QUylQdFnQh-CQ5nxde1o1XOPSRU/s32/facebook-32.png);
}
¿Nos sigues?
a class="twitterimg" href="http://www.twitter.com/oloman"/a span id="twitter_count"/span
a class="facebookimg" href="http://www.facebook.com/oloblogger"/a span id="fb_count"/span/div
Código que nos daría un pequeño cuadro con un par de imágenes que enlazan a nuestros perfiles y que nos muestran el número de seguidores/fans actuales.
Otra ejemplo. En este caso simulando unos botones antipixel:
position: relative;
width: 88px;
height: 15px;
margin: 0px auto;
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiawvW9q83mY09LNMvpbwx7bOiGsLDsXjGxMwP8stWmCbJxI214OBmk3730fnsM9HK5zSe8tumaE96TEvae-Gc_FS-_1e4AJM-1gKiO9zaR2qYJvApV8Go9T4Au-2jbxC8xkjH3NC3O2h8/s1600/antipixel.jpg);
font-family: arial;
font-size: 9px;
}
.antipixel a, .antipixel .nombre {
position: absolute;
top: 3px;
left: 0;
width: 38px;
height: 10px;
color: #000;
text-align: right;
}
.antipixel .nombre {
width:50px;
left: 43px;
text-align: left;
}
div class="antipixel"a href="http://www.facebook.com/oloblogger"span id="fb_count"/span/aspan class="nombre"Facebook/span/div
Idea basada en un código deDmolsen (Github)
Actualización BPT. Personaliza y carga este gadget automáticamente en Blogger:
Donate Car To Charity CALIFORNIA DONATE CAR FOR TAX CREDITDONATE CARS IN MADONATE YOUR CAR SACRAMENTOHOW TO DONATE A CAR IN CALIFORNIA DONATE YOUR CAR FOR KIDS,CAR INSURANCE QUOTES COLORADO ,NUNAVUT CULTURE,DAYTON FREIGHT LINESHARDDRIVE DATA RECOVERY SERVICES,DONATE A CAR IN MARYLAND,MOTOR REPLACEMENTS,CHEAP DOMAIN REGISTRATION HOSTING,DONATING A CAR IN MARYLANDMundial Football Los Abogado de lesiones personales en Chicago,FIFA World Cup son muy buenos en chicago y nos ofrecen una Cotizacion de seguro y Cotizacion de Seguro de Vida y Cotizacion de seguro de coches,mesotelioma. Y visitar mesothelioma lawyers o tambien podriamos visitar mesothelioma symptoms y lexington law tambien many people lexington law firm and merlin olsen mesothelioma many people mesothelioma trial lawyers and atlanta mesothelioma lawyers Mesothelioma law firm, massachusetts mesothelioma attorney EEUU,Selling annuity payments for cash,Sell my structured settlement,Sell structured settlement,Structured settlement,Structured settlement companies,Sell my annuity payments lump sum,Car accident lawyer Denver,Accident injury attorneys,Sell my annuity
car insurance quotes pa Tech school Casino domain name yahoo Custom Christmas cards Online casino personal injury solicitor asbestos mesothelioma lawsuit Structures Annuity Settlement CAR ACCIDENT LAWYERS Car insurance in South Dakota Social media platforms for business Motor Insurance Quotes Social media platforms Business finance group CHEAP DOMAIN REGISTRATION HOSTING Criminal defense lawyer Mobile casino Computer science classes online car donate Live casino HOME PHONE INTERNET BUNDLE Hire php developers Online Motor Insurance Quotes Criminal lawyer Mortgage Adviser DUI lawyer Make money online Australia Hire php developer Bankruptcy lawyer HOW TO DONATE A CAR IN CALIFORNIA Casino reviews Cheap Auto Insurance in VA FUTURISTIC ARCHITECTURE Cheap car insurance in Virginia donate old cars to charity Better conferencing calls Nunavut Culture los angeles motorcycle accident lawyer Gas/Electricity Php programmers for hire structured settlement cash out Best Seo company Donate cars in ma Donate Car to Charity California Service business software att call conference quotes car Online Stock Trading Business Voip Solutions car accident lawyer san bernardino Attorney anti spam exchange server WordPress themes for designers mesotheloma Hire php programmers earthlink business internet structured settlement broker donating used cars to charity Dwi lawyer Life Insurance Co Lincoln Car insurance quotes pa lawyers accidents Email Bulk Service mesotheliama Donating a Car in Maryland Met Auto Online motor insurance quotes Donating Used Cars to Charity Sell Annuity Payment google affiliate Donate Your Car Sacramento Forensics Online Course onlineclasses small business administration sba WordPress hosting Donate Old Cars to Charity PHD on Counseling Education structured settlement agreement structured settlement need cash now Php programmers Seo companies Best social media platforms for business New social media platforms adverse credit remortgage register free domains dallas mesothelioma lawyer mesotheioma Best social media platforms Custom WordPress theme designer donate your car for money Adobe illustrator classes Seo services attorney lawyer mesothelioma pharmacist jobs in chicago Webex Costs Business management software World Trade Center Footage Italian cooking school domain yahoo Html email LIFE INSURANCE CO LINCOLN Online Christmas cards DONATE YOUR CAR FOR MONEY Social media tools Seo company Online Colleges mesothelioma suit new mexico mesothelioma lawyer Online Classes DONATE A CAR IN MARYLAND structure settlements auto insurance cost by state fortis health insurance temporary WORLD TRADE CENTER FOOTAGE CAR INSURANCE IN SOUTH DAKOTA Photo Christmas cards Social media management Better Conference Calls Psd to WordPress Social media examiner Best Criminal Lawyers in Arizona Criminal Defense Attorneys Florida Massage School Dallas Texas Motor replacements PAPERPORT PROMOTIONAL CODE buyers of structured settlements Dallas Mesothelioma Attorneys Christmas cards mesothelioma attorney injury attorney baton rouge mesothelioma claims Hard drive Data Recovery Services Psd to html Car Insurance Quotes Colorado tucson car accident attorney Proud Italian cook mesothelioma lawyer california DONATE CARS IN MA WordPress theme designers car insurance quotes ONLINE MOTOR INSURANCE QUOTES accident attorneys orange county refinance with poor credit DAYTON FREIGHT LINES Social media strategies all about mesothelioma Learning adobe illustrator structured settlement brokers PSYCHIC FOR FREE domain registration yahoo supportpeachtreecom mesothelioma help Social media campaigns DONATE CARS ILLINOIS Car Insurance Quotes PA Mesothelioma Law Firm maritime lawyer houston Donate Car for Tax Credit Donate Cars in MA online motor insurance quotes seattle mesothelioma lawyer How to Donate A Car in California Car Accident Lawyers Auto Mobile Shipping Quote Donate Your Car for Kids Asbestos Lawyers CHEAP AUTO INSURANCE IN VA Annuity Settlements structured settlements companies new york mesothelioma law firm Dayton Freight Lines Car Insurance Companies caraccidentlawyer MOTOR REPLACEMENTS Car insurance quotes MN Donate a Car in Maryland Data Recovery Raid Motor Replacements Cheap Domain Registration Hosting mesothelioma attorney assistance Donate your Car for Money Donate Cars Illinois Royalty Free Images Stock chicago hair laser removal Personal Injury Law Firm lease management software wisconsin mesothelioma attorney Car insurance quotes Utah Car Insurance Quotes Utah philadelphia mesothelioma lawyer mesothelioma survival rates Holland Michigan College Insurance Companies WebEx costs mesothelioma law firms WEBEX COSTS asbestos lung cancer Paperport Promotional Code CRIMINAL DEFENSE ATTORNEYS FLORIDA personal injury attorney torrance Business VOIP Solutions Automobile Accident Attorney cheap domain registration hosting Psychic for Free truck accident attorney los angeles HARDDRIVE DATA RECOVERY SERVICES SELL ANNUITY PAYMENT fast cash for house Low Credit Line Credit Cards